expiration of all pending orders at 00.00 h (end of day)

Created at 02 Jan 2013, 13:49
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
TR

tradermatrix

Joined 24.07.2012

expiration of all pending orders at 00.00 h (end of day)
02 Jan 2013, 13:49


hello
I would like a solution to the expiration of all pending orders at 00.00 h (end of day).


j currently uses this method;

for example;
Trade.CreateSellStopOrder (Symbol, Volume, TargetPrice, StopLoss, TakeProfit, Exp);

DateTime = MarketSeries.OpenTime.LastValue.AddDays Exp (1);

but this method cancels orders 24 hours later. one after the other.

thank you for your understanding
cordially.


 


@tradermatrix
Replies

admin
03 Jan 2013, 12:05

Hello,

Set you "Exp" variable to 11:59:59.

DateTime Exp = MarketSeries.OpenTime.LastValue.Date.AddHours(24).AddSeconds(-1);

@admin

tanakorn5905
07 Nov 2015, 21:31

RE:

admin said:

Hello,

Set you "Exp" variable to 11:59:59.

DateTime Exp = MarketSeries.OpenTime.LastValue.Date.AddHours(24).AddSeconds(-1);

 


@tanakorn5905