Print inside a loop does not work!
Because i==0 is false from the start and the loop is never executed.
You should use i>=0
It works as you wrote it.
Loop runs while condition is true.
In your case it goes like this:
- set i = 5
- if i == 0
- else
- exit loop
- decrement i
Documentation on MQL5: Language Basics / Operators / Loop Operator for
- www.mql5.com
Loop Operator for - Operators - Language Basics - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
It was typo error, Thanks!
Hello, can someone explain to me why this does not work?