Need some help in controlling the no of open positions?
- How to have only one open trade at a time?
- Need help building an EA -- What function is used to modify an open position
- Discussion of article "Step-by-Step Guide to Writing an Expert Advisor in MQL5 for Beginners"
You have to assign a miagc numbr to your trades.
And use some code you get how many trades have been opened. Something like that:
for(int cnt=0;cnt<OrdersTotal();cnt++) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if(OrderMagicNumber() == MagicNumber) { TradesCount = TradesCount+1; } }Then before you open any order you can check the TradesCount < {MAX NUMBER OF TRADES YOU WANT)

Apologies for my insufficient knowledge,but can you tell me where in my ea i should paste this code in order to control maximum no of open trades just like its shown in the attachment.....If any other code is used for the purpose shown in the attachment,then Please do let me know about that code !!!
@ crashestdummy....well i hope you do.I downloaded this ea (the one in the picture) from http://www.platinumforexbot.com/free.htm ..If its not avalible anymore,then please do let me know.I'll attach my copy of ea in my next post if you wish.By the way,Best of luck :)