I am calling the LinReg method on my DataSeries in the OnBarUpdate of the secondary bar series but it is not updating. How would I call the updtae method to force it to update?
This is a code sample
// update fastClose series with the same number of elements needed in our indicator and with the current price in index 0
for (int i = 1; i <= sdPeriod; i++)
{
fastClose.Set(i, Closes[0][i]);
}
// always set index 0 of fastCLose to the currnet price
fastClose.Set(0, Closes[1][0]);
// THIS IS WHAT I NEED UPDATED
double answer = LinReg(fastClose,20)[0];
Print(" BarNumber " + CurrentBars[1] + " FastClose LinReg 20 Period = " + answer + " Current Price " + Closes[1][0]);

Comment