Skip to content

Simple script which calculates Fibonacci Bollinger Bands in Python and plots them on plotly offline

Notifications You must be signed in to change notification settings

gslinger/Fibonacci-Bands-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fibonacci Bollinger Bands

A simple script i wrote because i like Fibonacci Bollinger Bands and i couldn't find a version in python.

Basic formula is MA +/- (fib*(m*stddev))

Where fib represents fibonacci ratio, m represents the standard bollinger multiplier and MA represents the moving average, which currently is SMA.

Also contains a basic function to plot the fibonacci bands on a OHLC chart using plotly (offline).

alt text

Usage

Requirements: Pandas, Pandas_webreader, plotly, datetime

df = fibonacci_bollinger_bands(df, n=20, m=3)

df = dataframe which must contain 'Close', 'Open', 'High', 'Low' columns

n = Period for moving average

m = multiplier for bollinger bands (m * standard deviation)

returns: A dataframe with a new column for each band.

plot_fbb(df, fname="Test", n=20, m=3)

df = dataframe which must contain 'Close', 'Open', 'High', 'Low' columns

fname = File name to store the output graph (.html)

n = Period for moving average

m = multiplier for bollinger bands (m * standard deviation)

returns: A .html file containing the plotted graph. Will also open the graph in your default browser.

The if name == 'main' shows example usage.

About

Simple script which calculates Fibonacci Bollinger Bands in Python and plots them on plotly offline

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages