Pass for n times
-
I want to implement this scenario but it doesn't work:
Whenever MA 5 crosses above MA 20, it draws 5 vertical lines for the next 5 candles (one vertical line on each upcoming candle following the crossover). How can I fix this?This is how I though it would work:
https://fxdreema.com/shared/Jtc4ga5ze -
Set it up witout the loop, draw all at same time, use the shift forward in time, this is set up to work on 5m chart:

-
thank you very much.
Actually I mentioned 5 candles as an example.
In the real project I am working on, I sometimes need to do so on 52 upcoming candles. SO that adding 52 draw line blocks will be very difficult.
Isn't there any block or automatic way to do that? -
In the loop you can add to a variable, use this in your draw block, reset this when the next x happens before the loop starts