Pending orders issue
- HistoryOrderSelect not working for executed pending order
- Open Buy Code issue.
- Multiple orders issue
your pending triggered, it become Positions.
then you must use PositionSelectByTicket to check, not use HistoryOrderSelect.
I have a similar issue but slightly different. It occurs occasionally during fast moving market. I notice a open pending order that could't be deleted by EA and the market have passed that price. When i try deleting it manually is say ''invalid '',but when i restart MT4 it appears to be an open position. Can any help me or i'm experiencing the same issue ?
This code creates new pending Orders
}
This code check for order status
Please don't hijack old (and not related) topic. Thanks.
- When you post code please use the SRC button! Please edit your post.
General rules and best pratices of the Forum. - General - MQL5 programming forum ticket = OrderSend( Symbol(), OP_BUYSTOP, lotSize(), Ask + ( totalBuyStop + 1.0 ) * ( Point * TradeDelta ), Slippage, 0, 0, TradeComment, MagicNumber, 0 );
Check your return codes for errors and report them.
What are Function return values ? How do I use them ? - MQL4 and MetaTrader 4 - MQL4 programming forum
Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles- Pending order, once open, becomes buy/sell. You can't delete opened orders, they must be closed. The code you state "check for order status" is without context. We have no idea wether or how you selected the order before using OrderTicket.