Exercise

Implement Bollinger Bands

Bollinger Bands are envelopes plotted above and below a simple moving average of the price. Because the distance of the bands is based on the standard deviation, they adjust to volatility swings in the underlying price.

To better understand the impact of standard deviation specification on Bollinger bands, you will implement and plot two sets of Bollinger Bands on the same dataset.

You will use historical Bitcoin price data, which has been preloaded as bitcoin_data. The talib library has also been imported for you.

Instructions 1/2

undefined XP
  • 1
    • Define Bollinger Bands using 1 standard deviation for both the upper and lower bands.
    • Plot the upper and lower bands.
  • 2
    • Define Bollinger Bands using 2 standard deviations for both the upper and lower bands.
    • Plot the upper and lower bands.