A Ichimoku Cloud-based trading bot that allocates position sizes based on the Ichimoku Cloud to trade stocks (GME).
Note: Python Version 3.7+ is supported
- First install Blankly using
pip
. Blankly is hosted on PyPi.
$ pip install blankly
- Clone the repo --
git clone https://github.com/blankly-finance/IchimokuBot.git
- Ensure that you have your Alpaca API Keys connected and set sandbox to true. Check here for more details
- Run the python file
$ python ichimokucloud.py
- Voila! You have a stock trading bot that works based off the Kelly Criterion!
Blankly Metrics:
Calmar Ratio: 2.63
Compound Annual Growth Rate (%): 233.0%
Conditional Value-at-Risk: 69.1
Cumulative Returns (%): 3559.0%
Max Drawdown (%): 79.0%
Resampled Time: 86400.0
Risk-Free Return Rate: 0.0
Sharpe Ratio: 0.95
Sortino Ratio: 2.59
Volatility: 2.18
Value-at-Risk: 1044.72
Variance (%): 474.64%
Also viewable here.
This uses the Blankly package to build a trading strategy
We are able to utilize the Blankly.Strategy
object to easily create our price event that computes the Ichimoku Cloud, sets stop losses and profit targets, and generates a buy or sell signal based on the price action relative to the cloud. Once we add a ticker to the price event, we can backtest or live trade our strategy.
The Ichimoku Cloud is a technical indicator system that works off of the past low and high prices across a set of time periods. It was released in the 1960s by Goichi Hosoda and given a resolution generates a "cloud" -- a region between two lines along with an orientation (green or red). Price action breaking out of this "cloud" can be used as a signal to buy or sell.
Fork this repository, and start adding in some more indicators to also. Take this strategy live by adding strategy.start()