This repository is dedicated to KRISS 23/24 Fall Research project by Judy Park and Hangyeol Bae, HKUST.
Inverse Bollinger band is basically betting against the traditional Bollinger band, assuming non mean reversion. We buy when 20 MA hits upper Bollinger band, and sell when 20 MA hits lower band. We will clear our position if our profit/loss has reached our setting.
We have hypothesized that biotech stocks, under certain events, will not mean-revert due to their volatile nature. Thus, we will use this simulator to test our model in such cases - to be described further.
- ticker_crawler.py: contains
ticker_crawler
andcrawl_all
function used to crawl historical data, usesyfinance
module - strategy.py: contains strategy (SMA, Bollinger, inverse Bollinger)
- main.py: uses
backtrader
module to test strategy
- Build general outline [0.0.1]
- Implement algorithm
- Implement general algorithm (Bolinger band, inverse logic) [0.1.0]
- Finalize order size calculation [0.2.0]
-
Implement stop loss / take profit / order cancel algorithm
- Select target stock / period [0.1.2]
- Run simulation: trial & error [0.2.0 ~]
- Find best-profit parameter value
- Tabulate all information needed for the report
This project heavily adopts following modules:
Following resources were viewed or used as a reference.
- https://www.backtrader.com/docu/quickstart/quickstart/
- https://www.backtrader.com/docu/strategy/
- https://www.backtrader.com/blog/posts/2018-02-06-dynamic-indicator/dynamic-indicator/
- https://stackoverflow.com/questions/72273407/can-you-add-parameters-to-backtrader-strategy
- https://sjblog1.tistory.com/42
- https://aplab.tistory.com/entry/%ED%8C%8C%EC%9D%B4%EC%8D%AC-%EC%A3%BC%EC%8B%9D-%EB%B0%B1%ED%85%8C%EC%8A%A4%ED%8A%B8
- https://algotrading101.com/learn/yfinance-guide/
- https://community.backtrader.com/topic/3979/help-with-yahoofinance-data
- https://www.backtrader.com/docu/order-creation-execution/order-creation-execution/
- enzoampil/fastquant#202
- https://www.backtrader.com/docu/plotting/plotting/