Adding second Traling Stop Loss condition causes countertrend trade. Why?

Forums ProRealTime English forum ProOrder support Adding second Traling Stop Loss condition causes countertrend trade. Why?

Viewing 5 posts - 1 through 5 (of 5 total)
  • #97004

    Hi,

    So far I had one trailing stop condition which worked fine. Then I added a second condition which works partly.

    The short trade was exited after the second Trailing Stop condition was met. However, it created instantly a new long trade which should not happen.

    I guess something is not right with the order of the code.

    Can anyone help?

    Thanks.

    Sascha

     

    #97005

    To close a short order, you must use EXITSHORT, not BUY instruction.

    #97015

    Thanks Nicolas.

    However, I don’t just want to close the short position but I only want to adjust the stop loss to breakeven – 3 pip when CONDITION 1 is met and to breakeven – 1 pip when CONDITION 2 is met.

    The first part of the code (which contains CONDITION 1) you helped me to create and it works fine in ProBacktest.

    I then added the code for CONDITION 2 to it and was hoping it would work. But it now creates a new long position after it closed a trade that met CONDITION 2.

    I just want it to adjust the Stop loss.

     

    #97020

    I have to correct myself. I thought that the first part of the code (CONDITION 1) was working, but now when I checked again I realized it is not working.

    It produces the same mistake that after closing the short trade when the condition is met, it creates a new long trade.

    So I guess the command     buy at tradeprice-3*pointsize stop     doesn’t work and somehow creates this countertrend trade.

    I am confused now. How can I write the code that it  changes the Stop Loss to  entry price – 3 pips?

    Thanks so much for your help.

    #97022

    Problem solved:

    I read through everything again and then replaced the BUY instruction with EXITSHORT and now it works.

    Somehow I assumed that EXITSHORT would exit the position at market (that was my confusion) but as I use STOP it adjusts the Stop Loss as I wanted.

    Thank you again Nicolas.

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

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