Stopping A System When Profit is Reached

Forums ProRealTime English forum ProOrder support Stopping A System When Profit is Reached

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

    Hi,

    I am new here and I am testing a few systems in forex pairs which is looking good on backtests and I am paper trading currently. For me when a system makes a certain level of expected gains I want to stop it trading. Almost like a take profit but for the system not the trade.

    So if it hits its target of say £2000 in a period then I stop the system and I essentially don’t risk it then going on to make losing trades. I would like to setup each system to trade to certain level, stop it automatically then I start it manually when I wish to.

    #206479
    JS

    Hi @Tobias

    You could try something with:

    If StrategyProfit >= 2000 then

    PositionSize=0

    EndIf

    The algo then continues to run but no longer places orders…

    1 user thanked author for this post.
    #206486

    Or you could use Quit

    https://www.prorealcode.com/documentation/quit/

    2 users thanked author for this post.
    #206535

    Thanks for this. I suppose with your approach you can also just get it to “close for the day” also. I am a programmer so I am sure I can work it out.

    Both this and the quit keywork are really useful though thanks.

    Right now my stratedgy is making money but I think my risk reward ratio is off so I am either missing out on high gains that don’t quite top out then fall or on the other side losses that are obvious “losses” and should not be waiting around for a miracle to happen.  I am new to this so will read but if you have any suggestions on this they are most welcome.

    #206543

    I suppose with your approach you can also just get it to “close for the day” also.

     

    From another topic, from JS (no credits for me really) :

     

    You say “I want to keep the codes running” but do you also want your positions to remain open outside of your trading hours? If you also want to close your positions outside your trading hours, you can use: DefParam FlatBefore=090000 DefParam FlatAfter=170000

     

     

    1 user thanked author for this post.
    avatar JS
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