- Simplest Steps for MQL5 by Rethu Alex Mathew
- How can we refresh ?
- Coding help
All of the users will be happy with this.
You are indeed need to learn again :(
1. When executing some trading function, make sure to check the return of OrderSelect against OrderSymbol() and OrderMagicNumber() .
2. Check if there is error when executing some trade function (OrderSend, OrderClose, OrderDelete, OrderModify), and act accordingly to the error - retry the trade function or just forget it.
3. When closing position, close it with correct price using OrderClosePrice(), not MarketInfo(OrderSymbol(),MODE_BID) or MarketInfo(OrderSymbol(),MODE_ASK) .
4. When deleting position with ticket number, use the real ticket number, don't count up the ticket number from zero - because that is waste of resources. Or using SELECT_BY_POS, check if the position is indeed a pending order. Check also MarketInfo's MODE_FREEZELEVEL, just in case the pending is within the freeze level - which cannot be deleted.
And please don show off your programming skill saying superlative if you still learning https://www.mql5.com/en/forum/8982
- Agreed 1-3.
- #4 You can close pending or active orders when the market is closer than the maximum of FreezeLevel and MarketInfo(chart.symbol, MODE_STOPLEVEL)*Point

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use