Features
Technical indicators
Run and visualize technical analysis indicators and integrated libraries
✅ 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.
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()✅ VBT integrates most of the indicators from the Smart Money Concepts (SMC) library.
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()✅ 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.
data = vbt.YFData.pull("BTC-USD")
run_rsi = vbt.talib_func("rsi")
rsi = run_rsi(data.close, timeperiod=12, timeframe="M")
rsiDate
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: float64plot_rsi = vbt.talib_plot_func("rsi")
plot_rsi(rsi).show()✅ VBT integrates most of the indicators and consensus classes from freqtrade's technical library.
vbt.YFData.pull("BTC-USD").run("sumcon", smooth=100).plot().show()✅ 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.
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()✅ 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 🔥
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()✅ 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!
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()Tutorial
Learn more in the MTF analysis tutorial.
✅ 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()✅ Each of WorldQuant's 101 Formulaic Alphas is now available as an indicator 👀
data = vbt.YFData.pull(["BTC-USD", "ETH-USD", "XRP-USD"], missing_index="drop")
vbt.wqa101(1).run(data.close).outsymbol 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 © 2021–2026 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.