I have a problem with the following code and was wondering why it may not be working.
In the variables section I have;
TimeSpan sessionReset = new TimeSpan(00,55,00);
In OnMarketData
DateTime now = (Bars.MarketData.Connection.Options.Provider == Cbi.Provider.Replay ? Bars.MarketData.Connection.Now : DateTime.Now);
if(now.TimeOfDay == sessionReset)
{
//Reset Variables
}
Regards,
suprsnipes
P.S. Just noticed when using
Print(now.TimeOfDay + " " + sessionReset);
The now.TimeOfDay includes milliseconds, would this be causing issues?
Comment