How do I use Loop (pass "n" times") ?
-
Shouldn't this example draw 100 Vertical lines on the init?
Why is it not doing it?
How can I make it do it? -
Because that block needs an execution order for any and each loop. Putting it on the 'On Init' tab means it will be given just one. If you want 100 lines you should put both blocks on the 'On tick' tab. Then a new line will be drawn on every arriving tick until the hundredth.
-
Strange, I though it was a loop?
Because if I write this in a custom MQL code block:
for(int i=0; i<=100; i++){
ObjectCreate( "Time_vLine-"+Time[i], OBJ_VLINE, 0, Time[i], 0 );
ObjectSet( "Time_vLine-"+Time[i], OBJPROP_COLOR,clrRed);
}I get 100 vertical lines on the init....
Why is not the "Loop pass "n" times" not doing the same?
-
-
I'm afraid hardcore coding is not my field, sorry.

-
the name must be changed accordingly on each cycle to a specific name, your custom code changes it: "Time_vLine-"+Time[i]
but the Draw line block is not
find my examples and replies about loops and you can find the answer
-
@miro1360 ah, I see
I got it work, thank you
I'm going to study your loop examples too.
https://fxdreema.com/shared/ewgZNewxe