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!
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello, can someone explain to me why this does not work?