In mql5, i checked trigger with position Ticket but mql4 no support POSITION ENUM_POSITION_TYPE GetPositionType() { for(int pos = 0; pos < PositionsTotal(); pos++) { ulong posTicket = PositionGetTicket(pos); if(PositionSelectByTicket(posTicket)) { string commentArray[]; int k = StringSplit(PositionGetString(POSITION_COMMENT), ' ', commentArray); if(k > 0 && commentArray[0] == botName) { return PositionGetInteger(POSITION_TYPE); } } } return POSITION_TYPE_BUY; }
for(int pos = 0; pos < PositionsTotal(); pos++) { ulong posTicket = PositionGetTicket(pos); if(PositionSelectByTicket(posTicket)) { string commentArray[]; int k = StringSplit(PositionGetString(POSITION_COMMENT), ' ', commentArray); if(k > 0 && commentArray[0] == botName) { return PositionGetInteger
-
There are no positions in MT4, only orders.
Select the order and check its type. OP_BUY is an open order. OP_BUYLIMIT is still pending.
bool OrderIsPending(void){ return OrderType() >= OP_BUYLIMIT; }
-
There is no need to create pending orders in code.
-
The pending has the slight advantage, A) you are closer to the top of the queue (filled quicker), B) there's no round trip network delay (filled quicker.)
Don't worry about it unless you're scalping M1 or trading news.
-
Humans can't watch the screen 24/7, so they use pending orders; EAs can, so no need for pending orders, have it wait until the market reaches the trigger price and just open an order.
-
-
There are no positions in MT4, only orders.
Select the order and check its type. OP_BUY is an open order. OP_BUYLIMIT is still pending.
-
There is no need to create pending orders in code.
-
The pending has the slight advantage, A) you are closer to the top of the queue (filled quicker), B) there's no round trip network delay (filled quicker.)
Don't worry about it unless you're scalping M1 or trading news.
-
Humans can't watch the screen 24/7, so they use pending orders; EAs can, so no need for pending orders, have it wait until the market reaches the trigger price and just open an order.
-
thank u for sharing, my issue has resolved

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi everyone,
Ex: I have 2 order limit ( Buy Limit GOLD 1920 and Sell Limit 1925 )
When the price goes down to match the buy order, is there any way to check if it has matched the order to get information (opening direction) and delete the remaining sell limit order?
Thank you.