I wrote two indicators which I want to use at a strategy.
Each Indicator is plotting 3 chart-lines:
At Indicator A:
Values[0].set(value1A);
Values[1].set(value2A);
Values[2].set(value3A);
At Indicator B:
Values[0].set(value1B);
Values[1].set(value2B);
Values[2].set(value3B);
At the strategy (Initialize) I wrote:
Add (IndicatorA(1,2,3) /* 1,2,3 = parameters to IndicatorA */);
Add (IndicatorB(4,5,6) /* 4,5,6 = parameters to IndicatorB */);
At the stategy's OnBarUpdate I try to access the values of the two indicators:
Print (A(1,2,3).Values[0][0]);
Print (A(1,2,3).Values[1][0]);
Print (A(1,2,3).Values[2][0]);
Print (B(4,5,6).Values[0][0]);
Print (B(4,5,6).Values[1][0]);
Print (B(4,5,6).Values[2][0]);
I see that the strategy is calling the Indicators and I see both Indicators plots on the chart (all the plots are correct)
Looking at the output window:
The printing of IndicatorA values are right.
But the values of IndicatorB always print the Close price value. (At the chart the plots are corect)
I printed the BarsInProgress at the strategy OnBarUpdate, it is always = 0
what am I doing wrong?
thanks.

Comment