I'm trying to push a new live algo (ES Futures, set to change successfully in backtests on contract change, OpenInterest Mapping).

I get a contract swap when expected:

  1. 12/14/2022 12:00:00 AM - SymbolChanged event: 12/14/2022 12:00:00 AM ES Y4D62XFM9IPT->ES Y6URRFPZ86BL as part of my warmup.

But then I get this runtime error and it fails..

  1. Runtime Error: 1/1/2023 1:30:22 PM unexpected symbol changed event 1/1/2023 12:00:00 AM ES Y4D62XFM9IPT->ES Y6URRFPZ86BL!

I know we just had some downtime and we're on a new year closure but aside from waiting to launch this when the market opens, is there anything anyone see that could help me as there shouldn't have been a contract change (to the same contract) when the market is closed... 

In SetContract:

  1. CurrentContract = Securities[ContinuousContract.Mapped];
  2. CurrentContract_Symbol = CurrentContract.Symbol;

And in OnData:

  1. foreach (var changedEvent in data.SymbolChangedEvents.Values)
  2. {
  3. Debug($"{Time} - SymbolChanged event: {changedEvent}");
  4. if (Time.TimeOfDay == TimeSpan.Zero)
  5. {
  6. continue;
  7. }
  8. throw new Exception($"{Time} unexpected symbol changed event {changedEvent}!");
  9. }

Author

Echoes McCarthur

January 2023