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.
ticket = OrderSend( Symbol(), OP_BUYSTOP, lotSize(), Ask + ( totalBuyStop + 1.0 ) * ( Point * TradeDelta ), Slippage, 0, 0, TradeComment, MagicNumber, 0 );