How to use Loop: Pass "n" times?
-
FxDreema please help me how to use this block. I created this project:
https://fxdreema.com/shared/aaHBdtavb
I want in every bar to check last "Lookback" number of bars and count the number of bars fitting my bullish trend bad criteria (a bar has a higher high and higher low with respect to previous bar) But my bar count result is always "1". I tried several altertive ways to do this but always failed. I think my way to use Pass "n" times block is wrong, but what need to do?
Any help is appreciated

-
This loop is very very basic and does not stop by itself, so the value of LookBack is always decremented RunTimes times. I think this is the reason.
-
I tried to stop it with loop (break) but it did not work

Any other way to stop loop?
-
Not at the moment. As I said above, this block is very basic, it only does iterations and nothing more. It's code is as simple as this:
for (int i=1; i<=Cycles; i++) {~next~} ~inext~... where ~next~ is the orange output and ~inext~ is the yellow output.
Who knows when will I decide to add some "break" and "continue" blocks.
What if you turn these blocks into MQL4 code in a custom block?