Skip to content

Getting started

VectorBT® PRO (also known as vectorbtpro or simply VBT) is a next-generation engine for backtesting, algorithmic trading, and quantitative research. It is a high-performance, actively developed, proprietary successor to the vectorbt library, one of the most innovative open-source backtesting packages in the world. The PRO version builds upon the open-source package by adding impressive new features and valuable enhancements.

This tool is a community-led initiative aimed at addressing information asymmetry in trading. We bring together many SOTA tools and libraries under one umbrella and automate them. Our vision is to make quantitative analysis and algorithmic trading accessible to everyone. Join us!


Unique features

VBT has been completely refactored to enhance performance and enable new groundbreaking features, such as parallelization support.

Rapid development

VBT receives priority in development and maintenance. All major enhancements will be exclusively and immediately available to all eligible sponsors.

Easy to use

VBT offers a range of features and examples to make it more intuitive and easier to use. Our goal is to automate as many backtesting components as possible.

Private community

Join a Discord server with 1000+ members to share ideas and support each other. Get help faster and in more detail.

Tutorials

Access a variety of exclusive articles and tutorials covering many aspects and best practices for using the library.

Tech stack

Whether you are new or a seasoned programming expert, you will learn how to use the hottest Python tools to your advantage in trading.

💖

Appreciation

VBT is powered by its community. Financial contributions like yours ensure that the software remains safe to use for years to come. Thank you!

What is VBT?

VBT is a Python package that brings together various acceleration and data science tools to make trading strategies and markets more transparent for quants.

One of VBT's standout features is its ability to represent any trading setup as a set of multidimensional arrays, where each column corresponds to a distinct configuration of a trading strategy and its environment. This approach enables you to create and backtest entire grids of parameters at C speed while allowing for detailed analysis using Python's vibrant package ecosystem. This delivers the best of both worlds. Learn more.

Why VBT?

VBT takes an approach entirely opposite to traditional backtesting software: instead of running a backtesting job as a single monolithic process, VBT divides the job into many isolated components that you can combine like Lego bricks and run independently. These components include data, indicators, signals, allocations, portfolio, and more. Each component has its own ecosystem of analysis tools, allowing quants to analyze many facets of a trading strategy before it reaches the actual backtesting step. This also makes it easier to connect and integrate machine learning models at various points.

Importantly, VBT is built with parameter optimization in mind: even large parameter spaces can be tested almost instantly, allowing you to build dashboards and explore how even the smallest change in parameters affects overall performance in real time.

Example

Pull the daily history of the BTC/USDT and ETH/USDT pairs from Binance, backtest 20,000 configurations of the MACD indicator in a RAM-efficient way, and visualize the win rate as a function of the MACD parameters, in less than 30 seconds 🧊

from vectorbtpro import *

@vbt.chunked(chunk_len=1000)  # (1)!
def pipeline(  # (2)!
    data, 
    fastp: vbt.Chunked, 
    slowp: vbt.Chunked, 
    signalp: vbt.Chunked
) -> "concat":
    macd = vbt.talib("MACD").run(data.get("Close"), fastp, slowp, signalp)
    entries = macd.macd_above(0) & macd.macd_above(macd.macdsignal)  # (3)!
    exits = macd.macd_below(0) | macd.macd_below(macd.macdsignal)  # (4)!
    pf = vbt.Portfolio.from_signals(data, entries, exits, freq="d")
    return pf.trades.win_rate

btc_data = vbt.BinanceData.pull(["BTCUSDT"])  # (5)!
eth_data = vbt.BinanceData.pull(["ETHUSDT"])
param_product = vbt.combine_params(  # (6)!
    dict(
        fastp=vbt.Param(np.arange(4, 31)),
        slowp=vbt.Param(np.arange(4, 31)),
        signalp=vbt.Param(np.arange(4, 31))
    ),
    build_index=False
)

btc_win_rates = pipeline(btc_data, **param_product)  # (7)!
eth_win_rates = pipeline(eth_data, **param_product)
win_rates = pd.concat((btc_win_rates, eth_win_rates))  # (8)!

win_rates.vbt.volume(  # (9)!
    slider_level="symbol",
    trace_kwargs=dict(
        colorscale="icefire", 
        colorbar=dict(title='win_rate', tickformat='.0%'),
        cmid=0.5
    ),
).show()
  1. Use chunking to reduce RAM usage. Process at most 1000 parameter combinations at a time.
  2. Create a pipeline that returns the win rate for each parameter combination.
  3. Enter a position whenever the MACD line is above zero and the signal line.
  4. Exit the position whenever the MACD line is below zero or the signal line.
  5. Fetch both datasets separately to avoid NaNs.
  6. Generate 27 * 27 * 27 = 19,683 parameter combinations. Since fast and slow periods are conditionally bound, we could (and should) filter out combinations where the fast period is longer than the slow period, but this would only colorize half the cube.
  7. Win rates from each chunk are concatenated into a single series.
  8. Concatenate both series; they can still be distinguished by the index level "symbol".
  9. Plot a cube by creating a slider from the index level "symbol" and using the three parameter index levels as the X, Y, and Z axes.

Click on the "Dashboard" tab to see the graph. It may take a few seconds to render.

What about overfitting? VBT supports various cross-validation schemes and robustness tests to bring any backtest closer to reality. We do not recommend blindly selecting the best parameter set. The main benefit of this tool is to help you understand why a certain set of parameters produces a certain performance. After all, our goal is for you to grow as a quant.

What are prerequisites?

VBT is not your typical backtesting framework: instead of defining all logic in one place and only dealing with a limited set of commands, vectorbtpro is an open-ended tool that encourages you to adopt a data science approach to backtesting. This involves working with arrays, using third-party Python packages, building complex visualizations, and analyzing all sorts of artifacts along the way. It can sometimes be a steep learning curve.

With great freedom comes great responsibility, so at least some knowledge of Python and scientific computing is required. But even if you are new to these topics, do not worry: we will help you through tutorials, documentation, and our vibrant community 🤝

How to get access?

Become a member and choose the plan that fits your needs.

By subscribing to VBT, you gain immediate access to exclusive features, priority updates, and a private GitHub repository. You will join a thriving community of quants on Discord for direct support and collaboration. Subscribers also unlock in-depth tutorials, hands-on examples, and tools for high-performance backtesting and research.

Exclusive content

Installation Guide + Subscriber Perks on YouTube

VBT is hosted as a private GitHub repository. All new features are developed as part of this repository, so they are immediately and exclusively available to all eligible sponsors, as they are granted collaborator access to the repository.

  • Screen capture of the private repository


Eligible sponsors are also invited to join a private Discord server to receive the latest announcements, get support, vote on feature requests, and participate in discussions.

  • Screen capture of the private Discord server