I searched the message archives to see if this problem has been discussed before and it seems it has not.
It appears that if an indicator (indicator B) is referenced from another indicator (indicator A), any calls to High[Bar], Low[Bar], Close[Bar], Open[Bar] and Volume[Bar] in indicator B will result in 0 being returned as the value. To further illustrate this point, consider this psuedo example:
class IndicatorB
{
public double GetIndicatorValue()
{
double h = High[0];
double l = Low[0];
//perform some calculation and assign value to X
return X;
}
protected override void OnBarUpdate()
{
double x = GetIndicatorValue();
//plot it
}
}
When IndicatorB().GetIndicatorValue() is called from another indicator(IndicatorA), the returned value is always zero simply because High[0] and Low[0] are 0.
IndicatorB works as expected if it is inserted on a chart.
Both indicators were developed in NT6.5 and imported to NT7. This means that in NT6.5, IndicatorB is referenced from IndicatorA and it works as expected.
What changed in NT7 that is causing this problem?
Can one of NT folks provide a guideline as to how reference and use indicators from other indicators in NT7?
Thanks in advance.


Comment