Bollinger Bands analysis using Tableau

Download source files used in this article

Volatility analysis charts using Bollinger Bands are often used for trading decisions. Those who track stock price movements must be familiar with charts types shown below

Tableau_bollinger_band1

Bollinger Bands are intervals drawn on price chart at standard deviation levels above and below the corresponding moving average.

Bollinger Bands consist of :

  • an N-period moving average (MA)
  • an upper band at K times an N-period standard deviation above the moving average (MA + Kσ)
  • a lower band at K times an N-period standard deviation below the moving average (MA − Kσ)

Let us see how can we develop this chart using Tableau.

In this example, I connect to a database table which has daily price information of a stock. Simple data source – dimension as Date and measure as price.

Step one is to create a line chart, as shown below

Tableau_bollinger_band2

Next we need to add 4 calculated files

  • Moving Average
  • Standard Deviation
  • Upper Band
  • Lower Band

Tableau_bollinger_band3

Note: The above formulas have used 20 as N-period (look back period) and 2 as K-times to multiply since these are  typical values used in real world. If we need to change these dynamically, we can consider using them as parameter fields.

Add ‘Measure Names‘ as filter to your sheet (select MA, LB and UB in the filter selection). Then drag and drop ‘Measure Values’ to Rows in the chart.

Tableau_bollinger_band4.PNG

Choose ‘Dual Axis’ for Measure Values and synchronize the axis as next step.

Tableau_bollinger_band5.PNG

We have the Bollinger Bands generated; however the color schemes are not intuitive. So lets modify that a little.

Here is the final chart

Tableau_bollinger_band6.PNG

Download source files used in this article

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s