Stops and trailing stops

Forums ProRealTime English forum ProOrder support Stops and trailing stops

Viewing 3 posts - 1 through 3 (of 3 total)
  • #201130

    Can anyone help

    Yesterday for the first time in RTP I created an automatic trading order with the following risk management code

    // Stops and targets
    SET STOP pLOSS 100 pTRAILING 10
    SET TARGET pPROFIT 100

    PRT would not  accept this code with the message ‘Combined Stops can not be used with ProOrder’ although it is the default method when using simplified creation.

    So I resubmitted with the code

    // Stops and targets
    SET STOP pLOSS 100

    SET STOP pTRAILING 10
    SET TARGET pPROFIT 100

    which was accepted.

     

    However when I have backtested the two versions of the code I get very different results

    Can anyone explain why there is such a difference

    and how to use both a stop and trailing stop in ProOrder

     

    Regards

    Mark

     

    #201150

    thanks

    What are BBCodes and where can I find information on them

    Mark

    #201159

    BBCodes: https://it.wikipedia.org/wiki/BBCode#Comandi_BBCode

    You solution:

    is now formally correct, but SET STOP pLOSS 100 will ALWAYS be overridden by the next line SET STOP pTRAILING 10, as code is read sequentially. You have to use only one of the two lines or, if you need both a Stop Loss and a Trailing Stop, you have to use SET STOP pLOSS 100 then resort to a code snippet to append to your code to manage the trailing stop, like this one (lines 17-56): https://www.prorealcode.com/blog/trading/complete-trailing-stop-code-function/

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