Bollinger Bands in T-SQL

Bollinger Bands® is a technical analysis tool trademarked by its inventor, John Bollinger. The basis for the bands is a simple moving average (SMA). Standard deviation lines are calculated above and under this moving average. Those lines are the Bollinger Bands.

The bands illustrate volatility, since they move apart when there are large movments (volatility) in a stock price, and they move together when there are small movements. The stock price movements within these bands are then used as indicators in trading.

This blog post will show how to calculate Bollinger Bands in T-SQL. This calculation will only work on SQL Server 2012 and later.


Continue ReadingBollinger Bands in T-SQL