Use of Time Filter is Killing an Entry

  1. Use of time is verified as the problem. I’ have used this for many years, all of a sudden its a statement killer.
  2. Code is verified correct.
  3. Simplified Example:

if
((Position.MarketPosition == MarketPosition.Flat)
&& (Times[0][0].TimeOfDay >= GlobalStart.TimeOfDay)
&& (Times[0][0].TimeOfDay <= TimeStop.TimeOfDay)
&& (Long == true)
&& (UseSMACross == true)
&& (Close[0] > SMA1[0]))

{ EnterLong(Convert.ToInt32(Contracts), @“Long”); }

I have noticed a series of glitches in the latest release. Is this one too?

If the time filters above are commented out, entries fire.

And yes to your first question, both time settings date-wise are within the same 12 hour frame, i.e. after Midnight CST & before 5 PM CST

Add some prints to see for yourself if the times are correct when the condition runs, if the code works with them commented out then they can’t be validated as true.

1 Like