Expiration date format
Created at 04 Oct 2012, 12:26
FU
Expiration date format
04 Oct 2012, 12:26
Hi there.
I'm unable to find any examples of the format required for the expiration date when using a CreateBuyStopOrder, even the ExpirationTime help page just uses "null":
[/docs/reference/calgo/api/pendingorder/expirationtime]
Does anyone know the proper format to use? It would be useful to know how to specify an exact date and time, and also how to specify a number of hours after the trade is initiated.
Thanks!
rkokerti
04 Oct 2012, 16:04
Hi!
Try this:
Trade.CreateBuyStopOrder(Symbol,Volume,TargetPrice,StopLoss,TakeProfit,Exp);
or
Trade.CreateSellStopOrder(Symbol,Volume,TargetPrice,StopLoss,TakeProfit,Exp);
Where Exp:
DateTime Exp = MarketSeries.OpenTime.LastValue.AddMinutes(60);
or
DateTime Exp = MarketSeries.OpenTime.LastValue.AddDays(1);
or
DateTime Exp = MarketSeries.OpenTime.LastValue.AddHours(1);
depends on your time scale. I hope it will help you.
@rkokerti