fulltilt:
I need a profit order close function for a EA, but this one will close all working orders
anyone can help to allow close for symbol and magic only?
I need a profit order close function for a EA, but this one will close all working orders
anyone can help to allow close for symbol and magic only?
All Only for(i=OrdersTotal()-1;i>=0;i--) { OrderSelect(i, SELECT_BY_POS);
for(i=OrdersTotal()-1;i>=0;i--) if (OrderSelect(i, SELECT_BY_POS) && OrderMagicNumber() == magic.number && OrderSymbol() == Symbol() ){
Was that so hard?
What are Function return values ? How do I use them ? - MQL4 forum
- Also if you use OrderClosePrice() you do not have to differentiate Buy/Sell and Bid/Ask in the OrderClose
MarketInfo(OrderSymbol(), MODE_BID)
Why use a function call when you can use Bid/Ask or OrderClosePrice()
many thanks, exactly what I was looking for ;-)
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
I need a profit order close function for a EA, but this one will close all working orders
anyone can help to allow close for symbol and magic only?