How can I restrict the number of opened positions not including pending orders
Hi Mafeng,
Count them. Iterate through OrdersTotal() of opened and pending orders, using OrderSelect() and any trading function you want to use, count only opened order using OrderType() OP_BUY and OP_SELL. If the count are more or equal that what you allowed then don't open any order.
Hi Mafeng,
Count them. Iterate through OrdersTotal() of opened and pending orders, using OrderSelect() and any trading function you want to use, count only opened order using OrderType() OP_BUY and OP_SELL. If the count are more or equal that what you allowed then don't open any order.
how do i used the order select?
how do i used the order select?
Hi Mafeng,
Like the answers from your previous topic https://www.mql5.com/en/forum/140389
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use