Move Stop Loss to BE

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #7923 quote
    GunnerNic
    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
    davidp13
    Participant
    Average
    #7939 quote
    GunnerNic
    Participant
    New

    Thanx Dave!

    #7957 quote
    Adolfo
    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
    Nicolas
    Keymaster
    Master

    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.

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 Nicolas
9 years, 8 months ago.

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