Loading...

Free Python

Basana Backtesting library with CryptoDataDownload Data Sources

Basana Backtesting library with CryptoDataDownload Data Sources


PyAlgoTrader vs Basana
Per the Official Github page, PyAlgoTrade is basically deprecated and no longer maintained, and they suggest using Basana. Basana is a great library for backtesting and is often used to evaluate the effectiveness of a trading strategy using historical data before risking real capital. Some features of Basana is that it is asynchronous and event driven (making it faster) and already has some built in features for cryptocurrencies. The purpose of this article is to demonstrate how to modify the Basana backtesting CSV input to accept cryptocurrency historical data files dynamically from CryptoDataDownload (without pre-downloading any files)!

Code
We take the basic Backtesting using SMA example from the Basana github homepage and add a function that allows us to use any file from CryptoDataDownload. The function will download from any exchange and for any cryptocurrency pair, and then format the file to feed the Basana script. Please feel free to modify to fit your purposes!

Live codebase Python