for(int i=order_total;i>=0;i--) { if(OrderSelect(i,SELECT_BY_TICKET,MODE_TRADES)) { if(OrderSymbol() == Symbol()) { counter ++; } } }
Select by position, not ticket. You are looping index not tickets.
Topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I will move your topic to the MQL4 and Metatrader 4 section.
Keith Watford:
Thanks alot!
Select by position, not ticket. You are looping index not tickets.
Topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I will move your topic to the MQL4 and Metatrader 4 section.
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
Hi community,
recently started algo trading and creating my own EA.
When I try to test my EA on tester, it works pretty well but when I use it on real pair, something go wild and it opens a trade at random time (the signal is Valid but I made max trades allowed per symbol which doesn't work).
Here's my code on mq4 expert:
Would love to hear your thoughts and if you find any issue with my code.
Thanks alot :)