Move Stop Loss to BE

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #7923 quote
    GunnerNicGunnerNic
    Participant
    New

    Hi all,

    I have a problem trying to bring my stop loss to break after price has moved in my favour, can anyone help?

    The following coding is not doing anything:

    // Stops and targets
    SET STOP PLOSS 180
    
    IF LONGONMARKET AND close-tradeprice(1) >= 270 THEN
    SET STOP LOSS (tradeprice(1) + 20)
    ENDIF

    Thank you in advance!

    Steve

    #7937 quote
    davidp13davidp13
    Participant
    Average
    #7939 quote
    GunnerNicGunnerNic
    Participant
    New

    Thanx Dave!

    #7957 quote
    AdolfoAdolfo
    Participant
    Senior

    Hey, did you fixed it yet? Here is a posible solution:

    // Stops and targets
    SET STOP PLOSS 180
    
    // Market Spread
    Spread = 1*Pipsize
    
    IF NOT ONMARKET THEN
    stoploss = 0
    ENDIF
    
    IF LONGONMARKET AND close-tradeprice(1) >= 270 THEN
    // SET STOP LOSS (tradeprice(1) + 20)
    stoploss = TradePrice(1)+spread
    ENDIF
    
    SELL AT stoploss STOP

    Have a nice day and better trading!

    Nicolas thanked this post
    #7964 quote
    NicolasNicolas
    Keymaster
    Legend

    Hey guys,

    Please also keep in mind that “+20” needs to be converted to the pip size of the instrument if needed.

    Adolfo thanked this post
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Move Stop Loss to BE


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
GunnerNic @gunnernic Participant
Summary

This topic contains 4 replies,
has 4 voices, and was last updated by NicolasNicolas
10 years, 4 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/24/2016
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...