Pause system after 2 losses

Forums ProRealTime English forum ProOrder support Pause system after 2 losses

Viewing 11 posts - 1 through 11 (of 11 total)
  • #173502

    Hello!
    I’m trying to add a parameter that won’t allow my system to continue trading after 2 consecutive losses in the same day, but without quitting the system. I’ve copy pasted from a couple of old threads here, but can’t quite get it to work. This is what I’ve “come up with”

    Does anyone know what I’m doing wrong or have any ideas about how to code this?

    #173504

    Seems fine to me, TRADEON variable should  be tested before entries:

     

    #173506

    I’ve added TRADEON to the buy conditions like you show, but it still seems to take more positions then “allowed”. Here is an example, though i reckon it’s not enough to go on. It shouldn’t have taken the position on the 6th at 19.18 with this code, am I right?

    #173509

    You should add this line just after line 3 (before ENDIF):

    but this has nothing to do with your issue.

    It’s a nother issue, since you never reset PERTE at the beginning of a new day, it may happen that you never enter at market again after 2 losses as STERATEGYPROFIT will never change again!

    The question you asked is to stop after 2 LOSSES, not after 2 trades.

     

    #173510

    Your issue is due to using POSITIONPERF instead of STRATEGYPROFIT.

    Try this code:

    #173513

    I believe I understand the logic of your code. Perte is set to 0 at new day and if two losses are recorded then tradeon=0. Makes sense.

    But it still takes positions after 2 losses. The positions are exactly the same as with the code I first used.

    It’s quite odd because if I change “if perte =2″ then to “if perte =1” it seems to work flawlessly, but then closes after 1 loss..

    #173515

    Pauses after 1 loss*

    #173516

    I think yoy haven’t added TradeON to your conditions to enter a position.
    My code works like a charm:

    #173523

    I’ve definitely added it, see that portion of my code here.
    As you can see from the other picture it still takes a position after the second loss just before 20.00.
    Shouldn’t it have paused after that loss?

    #173527

    If you write the code AFTER any entry, it will be evaluated correctly the next bar.
    As lines dealing with TradeON and perte affect entries, they should be place BEFORE them.
    Code is read and executed sequentially.

    2 users thanked author for this post.
    #173531

    I was not aware of that. It’s working perfectly now.

    Thanks!

    1 user thanked author for this post.
Viewing 11 posts - 1 through 11 (of 11 total)

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