Skip to content

blankly-finance/rsi-crypto-trading-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RSI Crypto Trading Bot - Binance

A Crypto Trading Bot on Binance trading BTCUSDT and ETHUSDT using RSI in 25 Lines of Code

Getting Started

Note Python Version 3.7+ is supported

  1. First install Blankly using pip. Blankly is hosted on PyPi.
$ pip install blankly 
  1. Ensure that you have your Binance API Keys connected, check here for more deatils
  2. Run the python file
$ python bot.py 
  1. Woila! You have a working Binance Crypto Trading Bot that trades BTCUSDT and ETHUSDT

Backtest Output

Blankly Metrics: 
Compound Annual Growth Rate (%):   1.0%
Cumulative Returns (%):            2.0%
Max Drawdown (%):                  38.0%
Variance (%):                      4.36%
Sortino Ratio:                     0.18
Sharpe Ratio:                      0.19
Calmar Ratio:                      0.16
Volatility:                        0.02
Value-at-Risk:                     305.38
Conditional Value-at-Risk:         20.38
Risk Free Return Rate:             0.0
Resampled Time:                    86400.0

How does this work?

This uses the blankly package to build a trading strategy in just 25 lines of code. We are able to utilize the Blankly.Strategy object to easily add our rsi_price_event(price, symbol, state) function that handles our core RSI logic that trades when RSI is less than 30 and sells when it is greater than 70.

What is RSI?

RSI or relative strength index is an oscillator that measures the strength of a trend (i.e. when a trend is gaining momentum or losing steam). As it oscillates, it tells us when specific upwards or downward trends are most likely to stop and reverse. This is typically found when an asset is oversold (less than 30) or overbought (greater than 70) and can be used as an indicator, in conjunction with many other metrics to produce a meaningful output.

Resources on RSI

What is RSI? - Investopedia Implementation of RSI

Next Steps

Fork this repository, and start adding in some more indicators to test combinations Take this strategy live by changing it to s.start()

Join our discord and check out our upcoming platform