Need support on this code with breakeven level

Forums ProRealTime English forum ProOrder support Need support on this code with breakeven level

  • This topic has 5 replies, 4 voices, and was last updated 6 years ago by avatarrama.
Viewing 6 posts - 1 through 6 (of 6 total)
  • #69040

    Set stop loss 25

    set target profit 200
    IF NOT ONMARKET THEN
    breakevenLevel=0
    ENDIF

    // — BUY SIDE —
    //test if the price have moved favourably of “startBreakeven” points already
    IF longonmarket AND close-tradeprice>=12*pipsize THEN
    //calculate the breakevenLevel
    breakevenLevel = tradeprice+2*pipsize
    ENDIF

    IF longonmarket AND close-tradeprice>=20*pipsize THEN
    //calculate the breakevenLevel
    breakevenLevel = tradeprice+10*pipsize
    ENDIF

     

    ******************************************************

    The above code is working exactly the way I wanted the problem when I am in profit >= stop loss moves to 10

    when the floating profit falls <=20 then stop loss moves to 2. I want to keep the stop loss at 10 once my floating profit was 20 then fallen below 20

     

    #69062

    Please avoid double posts, thanks, the other copy of this post inserted in another thread has been deleted to keep the potential answers from other users in only one thread (this one) and not split across separate multiple threads. Thanks for your understanding.

    #69066

    To write code, please use the <> “insert PRT code” button, to make code easier to read.

    You should post the whole strategy to test it and try to spot any issue.

    At first glance I warn you that

    will never be executed (at least on forex pairs), you should either write:

     

     

    #69088

     

    #69090

    sorry, mistake. I meant this one:

     

    #69109

    This code works only one stop loss

    not for variable stop loss

     

     

Viewing 6 posts - 1 through 6 (of 6 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login