Features

Technical indicators

Run and visualize technical analysis indicators and integrated libraries

Hurst exponent

✅ Estimating the Hurst exponent provides insight into whether your data is a pure white-noise random process or exhibits underlying trends. VBT offers five (!) different implementations.

Plot rolling Hurst exponent by method
data = vbt.YFData.pull("BTC-USD", start="12 months ago")
hurst = vbt.HURST.run(data.close, method=["standard", "logrs", "rs", "dma", "dsod"])
fig = vbt.make_subplots(specs=[[dict(secondary_y=True)]])
data.plot(plot_volume=False, ohlc_trace_kwargs=dict(opacity=0.3), fig=fig)
fig = hurst.hurst.vbt.plot(fig=fig, add_trace_kwargs=dict(secondary_y=True))
fig = fig.select_range(start=hurst.param_defaults["window"])
fig.show()
Rolling Hurst exponent by method over BTC-USD market data Figure data (JSON)

Smart Money Concepts

✅ VBT integrates most of the indicators from the Smart Money Concepts (SMC) library.

Plot previous high and low
data = vbt.YFData.pull("BTC-USD", start="6 months ago")
phl = vbt.smc("previous_high_low").run(  
    data.open,
    data.high,
    data.low,
    data.close,
    data.volume,
    time_frame=vbt.Default("7D")
)
fig = data.plot()
phl.previous_high.rename("previous_high").vbt.plot(fig=fig)
phl.previous_low.rename("previous_low").vbt.plot(fig=fig)
(phl.broken_high == 1).rename("broken_high").vbt.signals.plot_as_markers(
    y=phl.previous_high,
    trace_kwargs=dict(marker=dict(color="limegreen")),
    fig=fig
)
(phl.broken_low == 1).rename("broken_low").vbt.signals.plot_as_markers(
    y=phl.previous_low,
    trace_kwargs=dict(marker=dict(color="orangered")),
    fig=fig
)
fig.show()
BTC-USD OHLCV with previous weekly highs and lows and broken-level markers Figure data (JSON)

Lightweight TA-Lib

✅ TA-Lib functions wrapped with the indicator factory are very powerful because, unlike the official TA-Lib implementation, they can broadcast, handle DataFrames, skip missing values, and even resample to a different timeframe. Although TA-Lib functions are very fast, wrapping them with the indicator factory adds some overhead. To keep both the speed of TA-Lib and the power of VBT, the added features have been separated into a lightweight function that you can call just like a regular TA-Lib function.

Run and plot an RSI resampled to the monthly timeframe
data = vbt.YFData.pull("BTC-USD")
run_rsi = vbt.talib_func("rsi")
rsi = run_rsi(data.close, timeperiod=12, timeframe="M")  
rsi
Date
2014-09-17 00:00:00+00:00          NaN
2014-09-18 00:00:00+00:00          NaN
2014-09-19 00:00:00+00:00          NaN
2014-09-20 00:00:00+00:00          NaN
2014-09-21 00:00:00+00:00          NaN
                                   ...
2024-01-18 00:00:00+00:00    64.210811
2024-01-19 00:00:00+00:00    64.210811
2024-01-20 00:00:00+00:00    64.210811
2024-01-21 00:00:00+00:00    64.210811
2024-01-22 00:00:00+00:00    64.210811
Freq: D, Name: Close, Length: 3415, dtype: float64
plot_rsi = vbt.talib_plot_func("rsi")
plot_rsi(rsi).show()
BTC-USD RSI resampled to the monthly timeframe Figure data (JSON)

✅ VBT integrates most of the indicators and consensus classes from freqtrade's technical library.

Compute and plot the summary consensus with a one-liner
vbt.YFData.pull("BTC-USD").run("sumcon", smooth=100).plot().show()
Smoothed technical indicator buy and sell summary consensus for BTC-USD Figure data (JSON)

Renko chart

✅ Unlike regular charts, a Renko chart is built using price movements. Each "brick" appears when the price changes by a specified amount. Because the output has irregular time intervals, only one column can be processed at once. As with everything, VBT's implementation can translate a huge number of data points very fast thanks to Numba.

Resample closing price into a Renko format
data = vbt.YFData.pull("BTC-USD", start="2021", end="2022")
renko_ohlc = data.close.vbt.to_renko_ohlc(1000, reset_index=True)  
renko_ohlc.vbt.ohlcv.plot().show()
BTC-USD closing price resampled into a Renko OHLC chart Figure data (JSON)

Rolling OLS

✅ Rolling regressions are models for analyzing changing relationships among variables over time. In VBT, this is implemented as an indicator that takes two time series and returns the slope, intercept, prediction, error, and the z-score of the error at each time step. This indicator can be used for cointegration tests, such as determining optimal rebalancing timings in pairs trading, and is also (literally) 1000x faster than the statsmodels equivalent RollingOLS 🔥

Determine the spread between BTC and ETH
data = vbt.YFData.pull(
    ["BTC-USD", "ETH-USD"],
    start="2022",
    end="2023",
    missing_index="drop"
)
ols = vbt.OLS.run(
    data.get("Close", "BTC-USD"),
    data.get("Close", "ETH-USD")
)
ols.plot_zscore().show()
Rolling OLS spread z-score between BTC and ETH during 2022 Figure data (JSON)

✅ Comparing indicators on different time frames involves many nuances. Now, all TA-Lib indicators support a parameter that resamples the input arrays to a target time frame, calculates the indicator, and then resamples the output arrays back to the original time frame. This makes parameterized MTF analysis easier than ever!

Run SMA on multiple time frames and display the whole thing as a heatmap
h1_data = vbt.BinanceData.pull(
    "BTCUSDT",
    start="3 months ago UTC",
    timeframe="1h"
)
mtf_sma = vbt.talib("SMA").run(
    h1_data.close,
    timeperiod=14,
    timeframe=["1d", "4h", "1h"],
    skipna=True
)
mtf_sma.real.vbt.ts_heatmap().show()
BTCUSDT simple moving averages across hourly, four-hour, and daily timeframes Figure data (JSON)

Tutorial

Learn more in the MTF analysis tutorial.

TA-Lib plotting

✅ Every TA-Lib indicator is fully capable of plotting itself, based entirely on output flags!

data = vbt.YFData.pull("BTC-USD", start="2020", end="2021")

vbt.talib("MACD").run(data.close).plot().show()
TA-Lib MACD, signal, and histogram for BTC-USD during 2020 Figure data (JSON)

✅ Each of WorldQuant's 101 Formulaic Alphas is now available as an indicator 👀

Run the first alpha
data = vbt.YFData.pull(["BTC-USD", "ETH-USD", "XRP-USD"], missing_index="drop")

vbt.wqa101(1).run(data.close).out
symbol                      BTC-USD   ETH-USD   XRP-USD
Date
2017-11-09 00:00:00+00:00  0.166667  0.166667  0.166667
2017-11-10 00:00:00+00:00  0.166667  0.166667  0.166667
2017-11-11 00:00:00+00:00  0.166667  0.166667  0.166667
2017-11-12 00:00:00+00:00  0.166667  0.166667  0.166667
2017-11-13 00:00:00+00:00  0.166667  0.166667  0.166667
...                             ...       ...       ...
2023-01-31 00:00:00+00:00  0.166667  0.166667  0.166667
2023-02-01 00:00:00+00:00  0.000000  0.000000  0.500000
2023-02-02 00:00:00+00:00  0.000000  0.000000  0.500000
2023-02-03 00:00:00+00:00  0.000000  0.500000  0.000000
2023-02-04 00:00:00+00:00 -0.166667  0.333333  0.333333

[1914 rows x 3 columns]

Copyright © 20212026 Oleg Polakow. All rights reserved.

Site content and documentation are provided for using and evaluating VectorBT PRO and for educational purposes. Any other use, including building or supporting competing products or services, requires prior written consent.