Order Expiry
use time as secinds for expiry
formulation of secinds time for midnite next busyness day and use it as epiry time in OrderSend(), ok.
formulation of secinds time for midnite next busyness day and use it as epiry time in OrderSend(), ok.
Example:
int stopHour=0;
int StopMinute=0;
datetime [b]stopTime[/b]=StrToTime(StringConcatenate(Year(),".",Month(),".",Day()+1," ",stopHour,":",StopMinute));
int lifeTime=stopTime-TimeCurrent();
OrderSend(Symbol(),OP_BUYLIMIT,0.1,Ask-50*Point,Slippage.0,0,StringConcatenate("pending order for ",lifeTime," seconds"),0,[b]stopTime[/b],Blue);
Thanks Rosh,
Day()+1 from your example above gives me the current date somehow.
Day()+1 from your example above gives me the current date somehow.
I need to cancel all outstanding orders at midnight next business day.