Skip to main content

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 cadf_test, johansen_test
from radium.strategy import BollingerPair


# Alpha-vantage API Key
API_KEY = ''

# Creates equity, pair objects for visa and mastercard 2015-2021
equity1 = Equity('KO', '2016-01-01', '2021-01-01', API_KEY)
equity2 = Equity('SBUX', '2016-01-01', '2021-01-01', API_KEY)
pair = Pair(equity1, equity2)

# Visualise data
pair.plot_closed()

# Test for cointegration
cadf_test(pair)
johansen_test(pair)

# Hedge the pair
pair.hedge('OLS', 30)

# Backtest Bollinger band strategy on pair
entry_z = 1
exit_z = 0
lookback = 30
bollinger = BollingerPair(pair, entry_z, exit_z, lookback)

# Evaluate strategy
CAGR = bollinger.CAGR
sharpe = bollinger.sharpe

print(f"Compound Annual Growth Rate: {CAGR}")
print(f"Sharpe ratio: {sharpe}")

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

Radium-Tech-0.0.4.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

Radium_Tech-0.0.4-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file Radium-Tech-0.0.4.tar.gz.

File metadata

  • Download URL: Radium-Tech-0.0.4.tar.gz
  • Upload date:
  • Size: 10.4 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

Hashes for Radium-Tech-0.0.4.tar.gz
Algorithm Hash digest
SHA256 5596285a159573cf4b8368ea114bc97e0acddb491d6164aa11336f6f78391b25
MD5 27fac0548cac27db66a79d16ea1d88a3
BLAKE2b-256 d3b9d98134c9500e4fbd9550f44bf608011a151b8826a9f1265ad26e5e15b10d

See more details on using hashes here.

File details

Details for the file Radium_Tech-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: Radium_Tech-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 17.7 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

Hashes for Radium_Tech-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 29a792e60f1c1038b761480b6c9b58d235cc9f61ed00058274608c5d424ee4fc
MD5 2fd9f7730b3c68072d9877ec1b205eb4
BLAKE2b-256 2b0cdf9f3bf611a44dec56366448227e7ff430fc77bfa637fd3f49ce42e33028

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page