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.
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:
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?
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.