https://github.com/coasensi/bollingerbands-backtest
Python Bollinger Bands algorithmic trading strategy backtest
https://github.com/coasensi/bollingerbands-backtest
algorithmic-trading backtesting bollinger-bands python
Last synced: about 2 months ago
JSON representation
Python Bollinger Bands algorithmic trading strategy backtest
- Host: GitHub
- URL: https://github.com/coasensi/bollingerbands-backtest
- Owner: coasensi
- License: mit
- Created: 2024-07-19T12:41:54.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-22T18:58:17.000Z (about 1 year ago)
- Last Synced: 2025-05-30T03:39:13.211Z (4 months ago)
- Topics: algorithmic-trading, backtesting, bollinger-bands, python
- Language: Jupyter Notebook
- Homepage:
- Size: 5.1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This Python program is designed to backtest a technical analysis based algorithmic trading strategy.
**The strategy**
The Bollinger Bands strategy is a technical analysis tool used to identify overbought and oversold conditions in the market. It involves calculating three lines: a simple moving average (SMA, 20 days in our example) of the stock price, an upper band set at 2 standard deviations above the SMA, and a lower band set at 2 standard deviations below.
Signals are the following:BUY when the price crosses the lower band from the top. Hold until it crosses the upper band from below.
SELL when the price crosses the upper band from below. Hold until it crosses the lower band from the top.
This strategy leverages mean reversion, expecting prices to revert back to the mean (SMA) over time.
The initial report focuses on TSLA stock but additional reports provide backtests of this strategy on numerous stocks and indexes.