Create Compelling Reports with Tableau Bollinger Bands
Bollinger bands are a technical and practical analysis tool used in financial markets to identify probably buy and sell signals. They’re called for John Bollinger, who came up with the idea in the 1980s. Bollinger bands are three lines drawn on a chart: a simple moving average (SMA) in the centre, and two standard deviation bands above and below the SMA. The standard deviation bands are used to indicate the level of volatility in the market, and they expand and contract based on the price action of the security being analyzed.
To create Bollinger bands in Tableau, you will need to use a combination of calculated fields and reference lines. Here’s a general outline of the steps you can follow:
- Connect to your data source in Tableau and select the field you want to analyze (e.g. stock price).
- Create a calculated field for the SMA by using the AVG() function and specifying the number of periods you want to use (e.g. AVG([Price], 20) for a 20-period SMA).
- Create a calculated field for the upper standard deviation band by using the STDEV() function and adding the result to the SMA calculated field (e.g. [SMA] + STDEV([Price], 20)).
- Create a calculated field for the lower standard deviation band by using the STDEV() function and subtracting the result from the SMA calculated field (e.g. [SMA] – STDEV([Price], 20)).
- Drag the calculated fields for the SMA, upper standard deviation band, and lower standard deviation band onto the Columns and Rows shelves and select a line chart as the visualization type.
- To add reference lines to your chart, right-click on the SMA field in the Columns shelf and select “Add Reference Line”. Repeat this process for the upper and lower standard deviation bands.
- Customize the appearance and behavior of your Bollinger bands by using the options in the “Format” and “Analysis” menus.
Bollinger bands can be useful for identifying trends, overbought and oversold conditions, and other patterns in financial data. However, it’s important to remember that they are just one tool among many and should be used in conjunction with other forms of analysis.
To create Bollinger Bands you have to follow these steps:
- Create a calculated field for the moving average of the data set, using the WINDOW_AVG() function.
- Create a calculated field for the standard deviation of the data set, using the STDEV() function.
- Create a calculated field for the upper band, using the moving average plus two times the standard deviation.
- Create a calculated field for the lower band, using the moving average minus two times the standard deviation.
- Drag the moving average and upper and lower bands to the Rows or Columns shelf.
- Drag the measure you want to analyze to the “Detail” mark.
- Create a chart that shows the upper and lower bands, moving average and your measure (like line chart, scatter plot)
Bollinger Bands can help discover trends in stock prices and other financial data, but they should be used in tandem with other analysis techniques and indicators.