I looked through threads and didn't find answer for my question. How to send order at specific time (and cancel order at specific time too if it is not filled)?
I'm using:
Unmanaged = true; CalculateOnBarClose = false; (for my trailing stop)
protected override void OnBarUpdate()
{
...
if (((ToTime(Time[0]) >= StartTime) && (ToTime(Time[0]) < EndTime)))
{
Print("Send orders");
SendEntryOrders();
_bAllowTrading = false;
}
...
}
Please advice how to make it better.
Thank you for detailed answer in advance.
P.S. Sorry for my English.

Comment