Standard Deviation Channel

Standard Deviation Channel (SDC) is an overlay which plots standard deviations above and below the linear regression line. See the Linear Regression Study. The user may change the input (close), number of regression bars, number of future bars and the standard deviation factor. This indicator’s definition is further expressed in the condensed code given in the calculation below.

Standard Deviation Channel

How To Trade Using Standard Deviation Channel

The Standard Deviation Channel may be used as a momentum of a trend indicator. The slope of the line designates an upward or downward trend. The momentum is expressed by the width of the channel. No signals are generated and it should be used in conjunction with other indicators.

How To Access in MotiveWave

Go to the top menu, choose Add Study, start typing in Standard Deviation Channel 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 closing price)
//noBars = user defined, default is 40
//noFutureBars = user defined, default is 1;
//noDev = number of standard deviations user defined, default is 2
//standDev = standardDeviations
//index = current bar number

endIndex = size() -1;
startIndex = endIndex - noBars;
value[] = linRegLine(endIndex, noBars, input);
a = value[0];    //a in line equasion y = a + mx
m = value[1];   //m in line equasion y = a + mx
standDev = std(endIndex, noBars, input);
standDev = standDev * noDev;
standDev = standDev * .5;  //half above half below
 //y = a + (m * x)
startY = a + (m * 0);
endY = a + (m * noBars);
start = Coordinate(getStartTime(startIndex), startY);
end = Coordinate(getStartTime(endIndex), endY);
line = Line(start, end);
line.setExtendRight(noFutureBars);
addFigure(line);
 //top channel
startY = a + standDev; // + (m * 0)
endY = a + standDev + (m * noBars);
start = Coordinate(getStartTime(startIndex), startY);
end = Coordinate(getStartTime(endIndex), endY);
line = Line(start, end);
line.setExtendRight(noFutureBars);
addFigure(line);
 //bottom channel
startY = a - standDev; // + (m * 0)
endY = a - standDev + (m * noBars);
start = Coordinate(getStartTime(startIndex), startY);
end = Coordinate(getStartTime(endIndex), endY);
line = Line(start, end);
line.setExtendRight(noFutureBars);
addFigure(line);