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
In MQL4 only OrdersTotal
And check in search
I remember when MT used to evaluate all statements in the expression regardless of truthiness (pre build 600) and you had to use continue, however, that's no longer the case. Now, the expression stops being evaluated after the first false condition so if you want to flatten your code block you can do it like this, omitting the continue statements.
Since OP_BUY == 0 and OP_SELL == 1 you can achieve a slightly more perfomant loop by simply comparing order type < 2
... and it should go without saying that if you want to count the positions then you'd make your own function.
Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 and MetaTrader 4 - MQL4 programming forum
MagicNumber: "Magic" Identifier of the Order - MQL4 Articles