RSI Algorithmic Trading with Python

Overview

RSI Algorithmic Trading with Python

In this repository you can see my first algorithhmic trading script. I use 5 cryptocurrencies: Bitcoin (BTC), Ethereum (ETH), Bitcoin Cash (BCH), Litecoin (LTC) and Chainlink (LINK).

Trading based on a cross of RSI indicators

The Relative Strength Index (RSI) is a technical indicator used in the analysis of financial markets. It is intended to chart the current and historical strength or weakness of a stock or market based on the closing prices of a recent trading period.

Here I test a method to invest in based on crossing RSI indicators. I set two windows: a short one of 9 periods and a long one based on 25 periods. You can change it easily.

short, long = 9, 25

The rule to trade is as following:

  1. If the short RSI indicator is over the long RSI indicator, it buy the cryptocurrency.
  2. If the short RSI indicator is under the long RSI indicator, it sell the cryptocurrency.
  3. The weight is allocated equally between every currency that is recommended to buy.
  4. If there no currency avalilable to invest, it keep money in cash (fiat currency).

Periods of time

I recommend using a time interval of 1 day since according to the tests I have carried out, it is the most profitable period due to the exchange's fees (0.5% for maker and taker in market orders).

You can change the base period of time in the next variable:

#[60 = "1min", 300 = "5min", 900 = "15min", 3600 = "1h", 21600 = "6h", 86400 = "1d"]
granularity = 60

Time expressed in seconds.

Coinbase Pro API

You must create an API key in Coinbase Pro > Profile > API. You need three different strings:

key = "YOUR API KEY GOES HERE"
b64secret = "YOUR SECRET API KEY GOES HERE"
passphrase = "YOUR PASSPHRASE GOES HERE"

Cryptocurrencies and fiat money

You can easily change which cryptos you want the script to trade. You can change your fiat currency too.

#Your fiat currency here, preferably USD or EUR
fiat = "EUR"

#Cryptocurrencies you want to trade
coins = [fiat, "BTC", "ETH", "BCH", "LTC", "LINK"]

I have tested that the script works with EUR and USD.

References

This project is based on the following article:

You might also like...
The leading native Python SSHv2 protocol library.

Paramiko Paramiko: Python SSH module Copyright: Copyright (c) 2009 Robey Pointer [email protected] Copyright: Copyright (c) 2020 Jeff Forcier

Python binding to the Networking and Cryptography (NaCl) library

PyNaCl: Python binding to the libsodium library PyNaCl is a Python binding to libsodium, which is a fork of the Networking and Cryptography library. T

cryptography is a package designed to expose cryptographic primitives and recipes to Python developers.

pyca/cryptography cryptography is a package which provides cryptographic recipes and primitives to Python developers. Our goal is for it to be your "c

A self-contained cryptographic library for Python

PyCryptodome PyCryptodome is a self-contained Python package of low-level cryptographic primitives. It supports Python 2.7, Python 3.4 and newer, and

Python ASN.1 library with a focus on performance and a pythonic API

asn1crypto A fast, pure Python library for parsing and serializing ASN.1 structures. Features Why Another Python ASN.1 Library? Related Crypto Librari

Bitcoin Clipper malware made in Python.
Bitcoin Clipper malware made in Python.

a BTC Clipper or a "Bitcoin Clipper" is a type of malware designed to target cryptocurrency transactions.

📊Python implementation of the Colin Talks Crypto Bitcoin Bull Run Index (CBBI).
📊Python implementation of the Colin Talks Crypto Bitcoin Bull Run Index (CBBI).

Colin Talks Crypto Bitcoin Bull Run Index (CBBI) This is a Python implementation of the Colin Talks Crypto Bitcoin Bull Run Index (CBBI). It makes use

Learn Blockchains by Building One, A simple Blockchain in Python using Flask as a micro web framework.
Learn Blockchains by Building One, A simple Blockchain in Python using Flask as a micro web framework.

Blockchain ✨ Learn Blockchains by Building One Yourself Installation Make sure Python 3.6+ is installed. Install Flask Web Framework. Clone this repos

The (Python-based) mining software required for the Nintendo Switch mining project.

ntgbtminer - Nintendo Switch edition This is a version of ntgbtminer that works with the Nintendo Switch bitcoin miner. ntgbtminer ntgbtminer is a no

Owner
Jon Aldekoa
Deep Learning and AI enthusiast. Learning in Coursera.
Jon Aldekoa
Technical_indicators_cryptos - Using technical indicators to find optimal trading strategies to deploy onto trading bot.

technical_indicators_cryptos Using technical indicators to find optimal trading strategies to deploy onto trading bot. In the Jup Notebook you wil

Van 4 Jul 3, 2022
Freqtrade is a free and open source crypto trading bot written in Python

Freqtrade is a free and open source crypto trading bot written in Python. It is designed to support all major exchanges and be controlled via Telegram. It contains backtesting, plotting and money management tools as well as strategy optimization by machine learning.

null 20.2k Jan 7, 2023
This python module can analyse cryptocurrency news for any number of coins given and return a sentiment. Can be easily integrated with a Trading bot to keep an eye on the news.

Python script that analyses news headline or body sentiment and returns the overall media sentiment of any given coin. It can take multiple coins an

null 185 Dec 22, 2022
Deribit_Algo_Project_Python - Deribit algo project written in python trading crypto futures

This is a Algo/script trading for Deribit. You need an account with deribit, to

null 24 Jan 9, 2023
This is a fully functioning Binance trading bot that takes into account the news sentiment for the top 100 crypto feeds.

This is a fully functioning Binance trading bot that takes into account the news sentiment for the top 100 crypto feeds.

Andrei 1.5k Jan 4, 2023
Bot to trade crypto trading ranges

crypto-trading-bot Crypto bot with DCA or GRID trading strategy Sends notifictions to telegram chat Crypto bot with webhook feature which can be used

null 3 Jun 18, 2021
A Trading strategy for the Freqtrade crypto bot.

Important Thing to notice 1) Do not use this strategy on live. It is still undergoing dry-run. 2) The Hyperopt is highly optimized towards "shitcoin"

null 160 Dec 26, 2022
Signarly is a cryptocurrency trading bot.

Signarly is a cryptocurrency trading bot.

Zakaria EL Mesaoudi 5 Oct 6, 2022
Cryptocurrency trading bot with a graphical user interface with support for simulations, backtests, optimizations, and running live bots.

Cryptocurrency trading bot with a graphical user interface with support for simulations, backtests, optimizations, and running live bots.

Mihir Shrestha 834 Dec 30, 2022
Python-RSA is a pure-Python RSA implementation.

Pure Python RSA implementation Python-RSA is a pure-Python RSA implementation. It supports encryption and decryption, signing and verifying signatures

Sybren A. Stüvel 418 Jan 4, 2023