Intuitive backtesting for quantitative trading strategies.
Project description
Radium
Radium-Tech is a Python package providing an intuitive backtesting and visualisation platform for quantitative trading strategies.
Main Features
In current version Radium-Tech can:
- Plot price data for multiple equities.
- Regress hedge ratios and price spread for a pair of equities.
- Conduct tests for cointegration on pairs of equities.
- Backtest a Bollinger Band strategy.
Future versions aim to add additonal mean-reversing strategies.
Where to get it
The latest public version of Radium-Tech is avaliable on Python Package Index (PyPI)
pip install Radium-Tech
Dependencies
Radium-Tech requires:
numpy
pandas
matplotlib
statsmodels
requests
An Alpha-Vantage free API key is also required for equity data.
Documentation
Official documentation for Radium-Tech is hosted on readthedocs.io: https://radium-tech.readthedocs.io/en/latest/
They can be downloaded in PDF form: https://radium-tech.readthedocs.io/_/downloads/en/latest/pdf/
Example
An example full backtest cycle can be found in Radium-Tech/Examples/bollinger.py
from radium import Equity, Pair
from radium.pair import johansen_test
from radium.strategy import BollingerPair
# Alpha-vantage API Key
API_KEY = ''
# Creates equity, pair objects for visa and mastercard 2015-2021
visa = Equity('V', '2015-01-01', '2021-01-01', API_KEY)
mastercard = Equity('MA', '2015-01-01', '2021-01-01', API_KEY)
v_ma = Pair(visa, mastercard)
# Visualise data
v_ma.plot()
# Test for cointegration
johansen_test(v_ma)
# Backtest Bollinger band strategy on pair
entry_z = 1
exit_z = 0
lookback = 30
v_ma_bollinger = BollingerPair(v_ma, entry_z, exit_z, lookback)
# Evaluate strategy
sharpe = v_ma_bollinger.sharpe()
ann_returns = v_ma_bollinger.ann_returns()
print(f"Sharpe ratio: {sharpe}")
print(f"Annualised returns: {ann_returns}")
Authors
Radium-Tech is developed by Ivan Erlic and Callum Rai of University College London.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file Radium-Tech-0.0.2.tar.gz
.
File metadata
- Download URL: Radium-Tech-0.0.2.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.25.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d748b939a4a27a9450390253833fcc19ad8f6303375107cb2b27269d92cee44 |
|
MD5 | 53ad145813c4039485dae310e70dbd82 |
|
BLAKE2b-256 | 9737acc9e101ec9baea20b682827e27331f62b1f99fd63887a2193b852d1b812 |
File details
Details for the file Radium_Tech-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: Radium_Tech-0.0.2-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.25.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e732dbcc2fa829072bde5b5983806e0ce01deb4c3773cdd277dd5b2e1b6349c1 |
|
MD5 | 4e2f47f619195f3d438fef21d339785a |
|
BLAKE2b-256 | 5daa72cec6bdb569c4c4c389041333c9e89159bcdaab1a62a10d7bb30ed4388d |