Hi 

I'm coding up a classic equities Momentum portfolio strategy which uses an sma on the index as a filter to allow buying or commence scale out of portfolio positions .  I'm using Coarse and Fine filtering on the Universe, then ranking those stocks by a custom momentum indicator and using risk parity position sizing based on recent volatility to establish and rebalance the portfolio. 

While the strategy doesn't trade the SPY, I've added it to the data feeds (and hence Universe I believe) to be able to calculate a moving average and use close > ma or below as filter as noted above. I've used the SymbolData pattern (holding a dictionary of symbols and instantiating a SymbolData object to handle indicators, warm them up, get values etc).

However the the numerical precision / factor file stuff is causing a problem that I don't understand - it's messing up the data being sent to OnData.  Basically it seems that something entirely unrelated to my strategy (factor data) is causing issues with the backtest.

Would appreciate some help from someone more experienced here. Is there a better approach that avoids this issue, or is it a bug in LEAN?

 

1998-02-02 00:00:00 :Due to numerical precision issues in the factor file, data for the following symbols was adjust to a later starting date: [SPY, 1/1/1998]1998-02-02 00:00:00 :The starting dates for the following symbols have been adjusted to match their map files first date: [SPY, 1998-01-02]1998-02-02 00:00:00 :Runtime Error: 'SPY' wasn't found in the Slice object, likely because there was no-data at this moment in time and it wasn't possible to fillforward historical data. Please check the data exists before accessing it with data.ContainsKey("SPY") in Slice.cs:line 329