8000 GitHub - yutiansut/vectorbt: Vectorized library for backtesting and trade optimization
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Vectorized library for backtesting and trade optimization

License

Notifications You must be signed in to change notification settings

yutiansut/vectorbt

 
 

Repository files navigation

vectorbt

Superfast backtesting and trade optimization

From indicators, signals, positions, equity, returns, to performance metrics and grid search: This package shares the same idea as behind the Quantopian and Zipline, but designed especially for fast strategy tuning. The code was made blazingly fast by using full vectorization with NumPy and multiprocessing.

The motivation behind this package is simple: "How to select the optimal windows for a SMA crossover strategy? Which strategy has the lowest risk? Which strategy yields the highest return? Are technical indicators of any use at all?"

Resulted in some cool animations such as how optimal hyperparameters change over time.

Installation

pip install git+https://github.com/polakowo/vector-bt.git

Tutorial

Tutorial is provided through Jupyter nbviewer

Bitcoin example

Exhaustive grid search over Bitcoin price.

Parameters: 1 year of 2h-period OHLC data, dual SMA crossover strategy with filter of 0.05 * STD and transaction fees of 0.0015 (Poloniex exchange). Heatmap below visualizes grid of SMA windows and the respective rates.

SMA-heatmap

Distribution of expectancy rates in SMA strategy.

SMA-dist

For comparison, here is the distribution of expectancy rates in random strategy.

random-dist

About

Vectorized library for backtesting and trade optimization

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 91.8%
  • Python 8.2%
0