It's quite simple:
if (IndyMethod ==1)
{ lr.Set (LinReg(Period)[0]); ltlr.Set(LinReg(ltperiod)[0]); }
if (IndyMethod ==2)
{ lr.Set(ZeroLagEMA(period)[0]); ltlr.Set(ZeroLagEMA(ltperiod)[0]);}
if (IndyMethod ==3)
{ lr.Set(EMA(period)[0]); ltlr.Set(EMA(ltperiod)[0]); }
if (IndyMethod ==4)
{ lr.Set(HMA(period)[0]); ltlr.Set(HMA(ltperiod)[0]); }
if (IndyMethod ==5)
{ lr.Set(ZeroLagHATEMA(period)[0]); ltlr.Set(ZeroLagHATEMA(ltperiod)[0]); }
if (IndyMethod ==6)
{ lr.Set(ZeroLagTEMAGauss(period)[0]); ltlr.Set(ZeroLagHATEMA(ltperiod)[0]); }
4,5 & 6 keep zeroing out, the others work fine all the time so I don't think it is the coding per se.
I understand I am not giving out the whole code - which has far too much in it with other things - but off hand: does anyone have any experience with a similar error and if so what is the fix? Perhaps I need some sort of starting condition and that is the problem, but it only happens on the current (last) bar, both in live and historical charts.
Here is a truncated pic (to keep within paltry forum limitations)
Comment