I have written Indicator1 which accepts 2 parameters and appears to work fine and do what I want it to.
I have created Indicator2 which uses the output of Indicator1. (Indicator1 actually uses a Dictionary to store key-value pairs rather than a Series or DataSeries object, since the indicator stores events (bar index, value) )l
Basically I create an instance of the Indicator1 object inside Indicator2 and initialize it. All compiles fine.
However, when I go to call members of Indicator1 none of the values are updated bar-by-bar - they are all set to their initial values i.e. zero.
This is true even if I create a simple int member of Indicator1 to store the CurrentBar.
e.g.
//inside Indicator1
public int dummy = 0;
protected override void OnBarUpdate()
{
dummy = CurrentBar;
}
//inside Indicator2
private Indicator1 myIndicator;
if(State == State.DataLoaded}
{
myIndicator = Indicator1(parameter1, parameter2)
}
protected override void OnBarUpdate()
{
Print(dummy);
}
Any ideas?
thanks

Comment