QUIT function when profit is reached

Forums ProRealTime English forum ProOrder support QUIT function when profit is reached

Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • #137199

    I want to stop my strategy if my floating profit >=10 pips

    I have tested QUIT function which is not working for floating profit. it is working only realized profit

     

    It will be most useful if we can use this for floating profit

    #137206

    QUIT is the function to stop the strategy. It has nothing to deal with the way you are calculating your profit!

    If you have used STRATEGYPROFIT, it is indeed the realized profit.

    The floating profit could be calculated as with this snippet:

    Code is read at bar close, so if your strategy is running on a 5-minutes timeframe and you want it to be read more times during a bar for orders management, use the TIMEFRAME instruction with a lower timeframe and place all your desired functions you want to act faster below it.

     

    #137476

    I am using the above code stop the system once profit >10 , I have asked the system stop once x>12 , as I am running this code in 1 second. here I am hoping that by the time program reached line 41 system has already moved my stop . Is there any way to stop system only after stop is moved?

    I am using the option “when trading system is stopped – Remain open” I want to keep my position when I am in profit

    #153860

    I suppose I’m doing something wrong because the system stops as soon as it detects the quit function in the code. It doesn’t even enter the market, it stops the system right away with the following code as a test run (it’s not my strategy, let’s be clear about that 😀 ):

    I get the following message from PRT: “this trading system has been stopped because of the presence of the quit function in the code.”

    How about that?

    #153865

    When the strategy starts STRATEGYPROFIT is zero, so line 7 is immediately TRUE and line 8 executed to stop the strategy.

    I suggest modifying line 7 so that it checks the strategy has entered at least one trade:

    but this will exit immediately if the first trade is a losing one.

     

     

     

    1 user thanked author for this post.
    #153871

    I was only testing simple coding lines to get to know the function..

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