Change a variable/flag after a LWL streak possible?

Forums ProRealTime English forum ProOrder support Change a variable/flag after a LWL streak possible?

Viewing 10 posts - 1 through 10 (of 10 total)
  • #174934

    Hi.

    Is there possible to change or set a variable/flag after the last three trades where LWL (loss win loss) or something similar? The problem for me is when it comes to more than the last two trades. Coding statements checking the last two trades works fine.

    Example code (not complete):

     

     

    Sincerely,
    Daniel.

    #174944

    You can keep track of the outcome of trades with this code:

    1 user thanked author for this post.
    #174952

    Thanks for your answer robertogozzi, I will definitely try that out. I won’t be able to do that until next weekend though, but will write back then again.

    Until then, I highly appreciate your answer!
    /Daniel

    #174979

    Hi again.

    I thought we would work normal hours this week but it’s still “summer hours”, so I got some extra time. 🙂

    I’ve tried your code but it seems to have the same problem. PRT still can only keep track of the last two trades.

    /Daniel

    #174996

    You wanted to detectc LWL, or any other sequence of your choice, to pause a strategy.

    The problem for me is when it comes to more than the last two trades“, what does that mean? what’s the problem there?

     

     

     

     

    #175041

    Yes I wanted to detect LWL but the code doesn’t do that (as you saw in the image I added in my previous reply). I painted in where there where LWL and the graph didn’t get triggered (otherwise it would get the true value 1 opposed to 0 in the picture in those positions). The image shows successful graph of LW I used as an example which works fine on the last two trades. But the platform (PRT) don’t seem to be able to check earlier than the last two trades when it comes to wins and losses. So to be clear, I want the graph to be triggered by LWL, then I know it works.

    Thanks again,
    Daniel.

    #175070

    Yes, I got it. The glitch was that that wirth [1]  the code is not accessing the previous result, bu the previous candle (the same for [2]).

    This one should do:

    1 user thanked author for this post.
    #175117

    Ok nice, I will definitely try that out later in the week.

    Thanks so far!
    /Daniel

    #175356

    Hi again.

    Yes it works great, thanks for your help Roberto!

    You have a nice weekend!
    /Daniel

    #175643

    Link to Roberto code above added as Log 299 here

    Snippet Link Library

    2 users thanked author for this post.
Viewing 10 posts - 1 through 10 (of 10 total)

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