Editor’s note: In Sylvain Vervoort’s article “Within The Volatility Band” in this issue, Vervoort already provides NinjaScript for his technique in a sidebar to the article. Here, NinjaTrader discusses a separate but related topic.
For this month’s Traders’ Tips, we will discuss standard error bands, which we are providing as an indicator that’s downloadable from www.ninjatrader.com/SC/August2013SC.zip.
Standard error bands can add a valuable and unique perspective to your charts. They are composed of a linear regression midline providing the best-fit trendline over the user-chosen lookback period, which is our period input in the NinjaScript study. We then place an envelope around this midline similar to the Bollinger Band/Keltner channel studies many traders are familiar with; however, in this case, we use the standard error and not the standard deviation to calculate the width of the envelope.
Without getting too deep into statistics, this will provide us with an interesting measurement allowing us to differentiate between trending vs. consolidation periods in our data. As the trending price action starts to unfold, the error will get smaller, since the results “stick” closer to our best-fit regression line, meaning we see a tightening of the bands.
On the other hand, choppy markets generally result in wider standard errors, offering the bands a chance to expand. Further, all band levels (here you have a choice to create two sets of width) can act as excellent support & resistance levels, assisting in trade selection and stop management.
FIGURE 9: NINJATRADER, STANDARD ERROR BANDS. This screenshot shows standard error bands applied to a 21-minute chart of a CL light sweet crude oil continuous contract.
Figure 9 shows that analysis with these bands doesn’t need to be limited to a price series, but can be expanded to oscillator-type studies, for example, as well. In our screenshot, we use our ultimate oscillator supplied as a default in NinjaTrader. As an added benefit, various smoothing algorithms can be set by the SwithMAType user input, providing flexibility.