I was working on a FunctionSimple<T> class and I hit exceptions. When I did more debugging I figured that I was referencing bars back and had to use FunctionSeries<T> instead. But I'm wondering if FunctionSimple<T> class is supposed to not reference values of previous bars, then why does it have indexers at all?! I would expect that if I use 'this[1]' in a FunctionSimple<T> declaration then it should give a compile error.
To try this you can use the following code (borrowed from here and changed FunctionSeries to FunctionSimple):
Code: Select all
public class CurrentBar : FunctionSimple<int>
{
public CurrentBar(CStudyControl master) : base(master){}
protected override int CalcBar(){
return this[1] + 1;
}
}