mql4writer01:
You tell it when you want the order to expire . . . so if the time now is TimeCurrent() add on 5 mins (5 * 60) and use that. It may well be rejected as being too close to the current time . . . if it fails check the error message.
I'm having difficulties with how to fill the field for expiration, I know it must be a datetime variable.
RaptorUK:
It may well be rejected as being too close to the current time . . . if it fails check the error message.
There is also ERR_TRADE_EXPIRATION_DENIED some brokers don't allow it.
It may well be rejected as being too close to the current time . . . if it fails check the error message.

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
Hi,
I want to place a pending order that will expire within 5 minutes (from the placement of the stop order).
Ticket=OrderSend(Symbol(),OP_BUYSTOP,Lot,StopPrice,Slippage,0,0,"OrderSend function",0001,here I must put the expiration,Blue); // Order send
I'm having difficulties with how to fill the field for expiration, I know it must be a datetime variable.
Thanks