Move stop to 75% of target

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #103201 quote
    SlowlyslowlySlowlyslowly
    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
    robertogozzirobertogozzi
    Moderator
    Legend

    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.
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 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 robertogozzirobertogozzi
7 years, 2 months ago.

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