Cancel pending orders at endo of the day
Created at 06 Dec 2018, 21:16
Cancel pending orders at endo of the day
06 Dec 2018, 21:16
Good night, I ask for help because I need to cancel pending orders at the end of the day. I tested the following code but it is not the best, I believe giving instructions specifically on changing Day candle would be the best.
Thank you so much.
protected override void OnTick() { if (Server.Time.Hour == 21 && Server.Time.Minute == 59) { foreach (var _PendingOrders in PendingOrders) { if (_PendingOrders.Label == Label) { Print("Cancel by time"); CancelPendingOrder(_PendingOrders); } } } }
Replies
DelFonseca
08 Dec 2018, 19:48
Thank you very much Panagiotis, It's perfect. You'r the greatest.
Best Regards!
@DelFonseca
PanagiotisCharalampous
07 Dec 2018, 10:07
Hi DelTrader,
I would suggest the below approach
Best Regards,
Panagiotis
@PanagiotisCharalampous