Move stop to 75% of target

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #103201 quote
    Slowlyslowly
    Participant
    Average

    Hi

     

    Fairly new here but struggling in the manual to find code instructions to do the following :

    Once 95% of target achieved move stop to 75% of target .

     

    Any help appreciated.

    #103210 quote
    robertogozzi
    Moderator
    Master

    There are no specific instructions, it’s a just a percentage applied to CLOSE (current price) compared to TRADEPRICE (entry price).

    You cannot set a SL to profit using SET STOP LOSS, but you have to use a pending order the other side (SELL if you are Long, EXITSHORT if you are Short). Examples for both (not tested):

    TargetProfit = ????         //you set it in pips
    IF (close - tradeprice) >= (TargetProfit * 0.95 * pipsize) THEN
       SELL AT Tradeprice + (TargetProfit * 0.75 * pipsize) STOP
    ENDIF
    TargetProfit = ????         //you set it in pips
    IF (tradeprice - close) >= (TargetProfit * 0.95 * pipsize) THEN
       EXITSHORT AT Tradeprice - (TargetProfit * 0.75 * pipsize) STOP
    ENDIF
    Slowlyslowly thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Move stop to 75% of target


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
6 years, 7 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/23/2019
Status: Active
Attachments: No files
Logo Logo
Loading...