Count bars since given signal

Forums ProRealTime English forum ProOrder support Count bars since given signal

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

    Hello,
    I would like to save an entry signal and count the bars from that signal to get another signal within 120 bars from the first signal. Cant seem to get it right.

     

    #128999

    Because you are not checking if there is a buysignal older than 120 bars in your condition at line 1.

    #129040

    Thank you, is this the correct way to do it? Im just weeks in my PRT “programingskills” =)

    #129045

    Yes, but on the first run, ‘buysignal’ is equal to 0, so you’ll have to wait for 120 bars before getting the first signal! So just check if that variable is equal to 0 too:

     

    1 user thanked author for this post.
    #129125

    Thank you, that worked perfectly! Is there also a way to save “signalprice” and to have a close over that for buysignal or is it just possible for number of bars?

    #129209

    You can save any value into a variable:

     

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