I have been tracking the history of several indicators the same way, but when I attempt to track my PSAR indicator, I get the following error.
Any ideas? Thanks,
Error:
Error CS0311 The type 'QuantConnect.Data.Market.IBaseDataBar' cannot be used as type parameter 'T' in the generic type or method 'HistoryTrackerImpl.Track<T>(IndicatorBase<T>, int)'. There is no implicit reference conversion from 'QuantConnect.Data.Market.IBaseDataBar' to 'QuantConnect.Data.BaseData'. QuantConnect.Algorithm.CSharp D:\Scott\OneDrive\Documents\Visual Studio 2015\Projects\Lean-master\Algorithm.CSharp\MacdEmaPsarAlgorithm.cs 119 Active
Declaration:
// define rollingwindows for indicator historypublic RollingWindow<IndicatorDataPoint> _MacdHistory;
public RollingWindow<IndicatorDataPoint> _EmaHistory;
public RollingWindow<IndicatorDataPoint> _PsarHistory;
Initialization (NOTE: line 119 is the last line below [_PsarHistory =...] ):
// create a MACD and track it's history, you can access// the current value of the MACD using MacdHistory[0],
// the previous value using MacdHistory[1], ect...
_MacdHistory = HistoryTrackerImpl.Track(MACD(_symbol, 12, 26, 9, MovingAverageType.Exponential, Resolution.Minute), 3);
// create an EMA and track it's history, you can access
// the current value of the EMA using EmaHistory[0],
// the previous value using EmaHistory[1], ect...
_EmaHistory = HistoryTrackerImpl.Track(EMA(_symbol, 18, Resolution.Minute), 3);
// create an PSAR and track it's history, you can access
// the current value of the PSAR using PsarHistory[0],
// the previous value using PsarHistory[1], ect...
_PsarHistory = HistoryTrackerImpl.Track(PSAR(_symbol, afStart: 0.002m, afIncrement: 0.002m, afMax: 0.20m), 3);