My thought is to use an abstract IndicatorList class, and then a sub-class of that for each actual list; some of the functionality will deal with exporting the data, etc, which can be shared through this top level abstract class. But when I try I don't have access to some of the Ninjascript functionality. What should the IndicatorList be a subclass of? I've tried various things and continue to run into snags. If it's a stand alone class, then I don't have access to the indicators and the Ninjascript functions (such as print to the output screen for debugging). Plus when trying to add an indicator I run into the following error:
I've added a blank protected overide OnBarUpdate methods, which appear not called at all (checked using print statements). And when in the sub-class of the IndicatorList class, the CurrentBar = -1, even though on the strategy calling the CurrentBar > 5. So it looks like how I have it set up, the OnBarUpdate method is not being called for the indicator list itself, or for the indicators which are part of the class either.
Could anyone offer a suggestion on a better architecture that could accomplish this purpose? Thanks. Here's some sample code:
{
public List<Indicator> _indList = new List<Indicator>();
public List<string> _indNameList = new List<string>();
public List<int> _indSettingsList = new List<int>();
public int _barIndex = 1;
public ATR _atr;
public void AddIndicators()
{
Print("adding base indicator");
// baseline ATR
_atr = ATR(10);
_indList.Add(_atr);
_indNameList.Add("ATR_10");
_indSettingsList.Add(0); ....
.......
Comment