✨ Usage
vectorbt allows you to easily backtest strategies with a couple of lines of Python code.
Here is how much profit we would have made if we invested $100 into Bitcoin in 2014:
Buy whenever 10-day SMA crosses above 50-day SMA and sell when opposite:
Generate 1,000 strategies with random signals and test them on BTC and ETH:
For fans of hyperparameter optimization: here is a snippet for testing 10,000 window combinations of a dual SMA crossover strategy on BTC, USD, and LTC:

Digging into each strategy configuration is as simple as indexing with pandas:
The same for plotting:
It's not all about backtesting - vectorbt can be used to facilitate financial data analysis and visualization.
Let's generate a GIF that animates the %B and bandwidth of Bollinger Bands for different symbols:

And this is just the tip of the iceberg of what's possible. Check out the website to learn more.
Installation
To also install optional dependencies:
Colab Notebook
License
This work is fair-code distributed under Apache 2.0 with Commons Clause license. The source code is open and everyone (individuals and organizations) can use it for free. However, it is not allowed to sell products and services that are mostly just this software.
If you have any questions about this or want to apply for a license exception, please contact the author.
Installing optional dependencies may be subject to a more restrictive license.
Star History
Disclaimer
This software is for educational purposes only. Do not risk money which you are afraid to lose. USE THE SOFTWARE AT YOUR OWN RISK. THE AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR TRADING RESULTS.