Forex Factory (https://www.forexfactory.com/)
-   Platform Tech (https://www.forexfactory.com/forum/69-platform-tech)
-   -   Close pending order in X time (https://www.forexfactory.com/thread/102722-close-pending-order-in-x-time)

turbano Aug 25, 2008 12:58pm | Post# 1

Close pending order in X time
 
Hi guys how can i make an order expire in X time?
Let's say my expert has a number of seconds

extern int Seconds = 60;

then i want the pending order of this EA to expire 60 seconds after they were opened, how can i do this in mt4?

Kindest regards

Ronald Raygun Aug 25, 2008 1:37pm | Post# 2

int OrderSend( string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment=NULL, int magic=0, datetime expiration=0, color arrow_color=CLR_NONE)

turbano Aug 25, 2008 7:05pm | Post# 3

Thanks, but i'm looking for a way to the order expire in seconds not in datetime format.

Ronald Raygun Aug 25, 2008 8:13pm | Post# 4

Ok...

extern SecondsToExpire = 60;

datetime expiration = 0;

start()

expiration = TimeCurrent() + SecondsToExpire;

turbano Aug 25, 2008 9:03pm | Post# 5

Thanks will try


© Forex Factory