Issue with stop strategy when CumulateOrders=True

Forums ProRealTime English forum ProOrder support Issue with stop strategy when CumulateOrders=True

  • This topic has 2 replies, 2 voices, and was last updated 4 years ago by avatarLéo.
Viewing 3 posts - 1 through 3 (of 3 total)
  • #151529

    Dear All,

    I am working for few days on the code below.

    This code works fine with DEFPARAM CumulateOrders = False but the trailing stop strategy does not work when I turn this option to true (DEFPARAM CumulateOrders = True)

    (The trailing stop strategy is coming from the MOD code – Thank you to the original author of this code)

    I am wondering if my issue is coming from the “Set Stop Ploss 200” that I added at the end of the code or if it is linked to the reset of the stoploss value.

    I would be gratefull if you can help me with this issue !

    Thank you in advance.

    Regards.

     

    #151548

    When accumulating positions, you will have more than one single TRADEPRICE, so ProOrder calculates the average of all trade prices and position sizes (attached pic).

    Replacing TRADEPRICE(1) with POSITIONPRICE should do.

    You can always use POSITIONPRICE even when you are not accumulating positions, in that case TRADEPRICE and POSITIONPRICE will match.

     

    #151550

    Hi Roberto,

    Thank you for this input. I will adapt the code and test accordingly !

    Thank you again.

     

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

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