Within OnBarUpdate I then have:
A[0] = High[0] - Low[0] ;
B[0] = Math.Abs(Close[0] - Open[0]) ;
C[0] = A[0] - B[0] ;
D[0] = SMA(C,6)[0] ; // This SMA produces a proper result
E[0] = C[0] / B[0] ; // This is just C normalized to B, i.e. (A - B) / B
F[0] = SMA(E,6)[0] ; // This Produces the NAN result
All of the series A through E produce proper results but series F gives NAN for some reason.
If, in series E, I replace B[0] with a constant such as:
E[0] = C[0] / 9.5 ;
Then F produces a correct result.
F[0] = SMA(E,6)[0]; // Produces a correct result when B[0] is replaced with a constant.
So why, in the series F, is the SMA choking on the division by B[0], yet the series E is just fine with the division by B[0]?
Thank you for your insights and fixes.

Comment