## Standard Error Percent Average

Standard Error Percent Average is part of Standard Error Bands by Jon Anderson, Stocks and Commodities Mag. 09/1996. This study should be used with R Squared, Linear Regression Slope and Bollinger Bands®. The user may change the input (close) and period lengths. This indicator’s definition is further expressed in the condensed code given in the calculation below. ### How To Access in MotiveWave

Go to the top menu, choose Study>Oscillators>Standard Error PerCent Average

or go to the top menu, choose Add Study, start typing in this study name until you see it appear in the list, click on the study name, click OK.

Important Disclaimer: The information provided on this page is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security. Please see our Risk Disclosure and Performance Disclaimer Statement.

### Calculation

//input = price, user defined, default is close
//period = user defined, default is 21
//sDegPeriod = user defined, default is 3
//av = average, index = current bar number
//sma = simple moving average
//y = value on the price axis, x = value on the time axis (bar number)

```inputV = price[index];
ret[] = sumMore(index, period, input);
sumV = ret;  //v = value user input usually close
sumV2 = ret;  //sum of value squared
sumVx = ret;  //sum of value * x
sumX2 = ret; //sum of x squared
avX = ret;
avV = ret;
sdEr = 0.0;
numB = sumVx - (period * avX * avV);
denB = sumX2 - (period * avX * avX);
calcB = numB / denB;
calcA = avV - (calcB * avX);
value1 = sumV2 - (calcA * sumV ) - (calcB * sumVx);
value2 = period - 2;
value3 = value1 / value2;
sdEr = sdEr; sumVx = ret;  //default value * x
lin[] = linRegLine(sDegPeriod, input, 0);
linRegY = lin;   //y value at position 0
if (value3 moreThan 0) sdEr = sqrt(value3);
linRegS = sma(index, sDegPeriod, linRegY);
sErr = 2 * sma(index, sDegPeriod, sdEr);
Plot: PA = (inputV - (linRegS-sErr)) / ((linRegS+sErr) - (linRegS-sErr)) * 100;```