vectorbt 1.2.0__tar.gz → 1.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. vectorbt-1.2.1/MANIFEST.in +2 -0
  2. {vectorbt-1.2.0/vectorbt.egg-info → vectorbt-1.2.1}/PKG-INFO +89 -47
  3. {vectorbt-1.2.0 → vectorbt-1.2.1}/README.md +87 -45
  4. {vectorbt-1.2.0 → vectorbt-1.2.1}/pyproject.toml +1 -1
  5. vectorbt-1.2.1/tests/__init__.py +0 -0
  6. vectorbt-1.2.1/tests/conftest.py +144 -0
  7. {vectorbt-1.2.0 → vectorbt-1.2.1}/tests/test_base.py +260 -0
  8. {vectorbt-1.2.0 → vectorbt-1.2.1}/tests/test_data.py +194 -0
  9. {vectorbt-1.2.0 → vectorbt-1.2.1}/tests/test_engine.py +116 -1
  10. {vectorbt-1.2.0 → vectorbt-1.2.1}/tests/test_generic.py +167 -5
  11. {vectorbt-1.2.0 → vectorbt-1.2.1}/tests/test_indicators.py +242 -0
  12. {vectorbt-1.2.0 → vectorbt-1.2.1}/tests/test_portfolio.py +210 -38
  13. {vectorbt-1.2.0 → vectorbt-1.2.1}/tests/test_records.py +3 -0
  14. {vectorbt-1.2.0 → vectorbt-1.2.1}/tests/test_returns.py +39 -0
  15. {vectorbt-1.2.0 → vectorbt-1.2.1}/tests/test_utils.py +53 -1
  16. vectorbt-1.2.1/tests/utils.py +61 -0
  17. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/_version.py +1 -1
  18. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/base/index_fns.py +84 -30
  19. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/base/reshape_fns.py +21 -6
  20. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/data/base.py +14 -2
  21. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/generic/nb.py +118 -38
  22. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/indicators/factory.py +9 -3
  23. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/indicators/nb.py +45 -8
  24. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/portfolio/base.py +6 -5
  25. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/portfolio/enums.py +4 -1
  26. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/portfolio/nb.py +25 -3
  27. vectorbt-1.2.1/vectorbt/py.typed +0 -0
  28. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/records/mapped_array.py +5 -5
  29. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/returns/nb.py +25 -3
  30. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/utils/config.py +5 -2
  31. {vectorbt-1.2.0 → vectorbt-1.2.1/vectorbt.egg-info}/PKG-INFO +89 -47
  32. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt.egg-info/SOURCES.txt +4 -0
  33. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt.egg-info/requires.txt +1 -1
  34. vectorbt-1.2.0/MANIFEST.in +0 -1
  35. {vectorbt-1.2.0 → vectorbt-1.2.1}/LICENSE.md +0 -0
  36. {vectorbt-1.2.0 → vectorbt-1.2.1}/setup.cfg +0 -0
  37. {vectorbt-1.2.0 → vectorbt-1.2.1}/setup.py +0 -0
  38. {vectorbt-1.2.0 → vectorbt-1.2.1}/tests/test_labels.py +0 -0
  39. {vectorbt-1.2.0 → vectorbt-1.2.1}/tests/test_plotting.py +0 -0
  40. {vectorbt-1.2.0 → vectorbt-1.2.1}/tests/test_settings.py +0 -0
  41. {vectorbt-1.2.0 → vectorbt-1.2.1}/tests/test_signals.py +0 -0
  42. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/__init__.py +0 -0
  43. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/_engine.py +0 -0
  44. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/_settings.py +0 -0
  45. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/_typing.py +0 -0
  46. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/base/__init__.py +0 -0
  47. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/base/accessors.py +0 -0
  48. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/base/array_wrapper.py +0 -0
  49. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/base/column_grouper.py +0 -0
  50. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/base/combine_fns.py +0 -0
  51. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/base/indexing.py +0 -0
  52. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/data/__init__.py +0 -0
  53. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/data/custom.py +0 -0
  54. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/data/updater.py +0 -0
  55. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/generic/__init__.py +0 -0
  56. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/generic/accessors.py +0 -0
  57. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/generic/decorators.py +0 -0
  58. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/generic/dispatch.py +0 -0
  59. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/generic/drawdowns.py +0 -0
  60. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/generic/enums.py +0 -0
  61. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/generic/plots_builder.py +0 -0
  62. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/generic/plotting.py +0 -0
  63. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/generic/ranges.py +0 -0
  64. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/generic/splitters.py +0 -0
  65. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/generic/stats_builder.py +0 -0
  66. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/indicators/__init__.py +0 -0
  67. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/indicators/basic.py +0 -0
  68. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/indicators/configs.py +0 -0
  69. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/indicators/dispatch.py +0 -0
  70. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/labels/__init__.py +0 -0
  71. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/labels/dispatch.py +0 -0
  72. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/labels/enums.py +0 -0
  73. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/labels/generators.py +0 -0
  74. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/labels/nb.py +0 -0
  75. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/messaging/__init__.py +0 -0
  76. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/messaging/telegram.py +0 -0
  77. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/ohlcv_accessors.py +0 -0
  78. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/portfolio/__init__.py +0 -0
  79. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/portfolio/decorators.py +0 -0
  80. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/portfolio/dispatch.py +0 -0
  81. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/portfolio/logs.py +0 -0
  82. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/portfolio/orders.py +0 -0
  83. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/portfolio/trades.py +0 -0
  84. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/px_accessors.py +0 -0
  85. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/records/__init__.py +0 -0
  86. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/records/base.py +0 -0
  87. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/records/col_mapper.py +0 -0
  88. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/records/decorators.py +0 -0
  89. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/records/dispatch.py +0 -0
  90. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/records/nb.py +0 -0
  91. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/returns/__init__.py +0 -0
  92. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/returns/accessors.py +0 -0
  93. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/returns/dispatch.py +0 -0
  94. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/returns/metrics.py +0 -0
  95. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/returns/qs_adapter.py +0 -0
  96. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/root_accessors.py +0 -0
  97. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/signals/__init__.py +0 -0
  98. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/signals/accessors.py +0 -0
  99. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/signals/dispatch.py +0 -0
  100. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/signals/enums.py +0 -0
  101. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/signals/factory.py +0 -0
  102. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/signals/generators.py +0 -0
  103. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/signals/nb.py +0 -0
  104. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/templates/dark.json +0 -0
  105. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/templates/light.json +0 -0
  106. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/templates/seaborn.json +0 -0
  107. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/utils/__init__.py +0 -0
  108. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/utils/array_.py +0 -0
  109. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/utils/attr_.py +0 -0
  110. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/utils/checks.py +0 -0
  111. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/utils/colors.py +0 -0
  112. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/utils/datetime_.py +0 -0
  113. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/utils/decorators.py +0 -0
  114. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/utils/docs.py +0 -0
  115. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/utils/enum_.py +0 -0
  116. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/utils/figure.py +0 -0
  117. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/utils/image_.py +0 -0
  118. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/utils/mapping.py +0 -0
  119. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/utils/math_.py +0 -0
  120. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/utils/module_.py +0 -0
  121. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/utils/params.py +0 -0
  122. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/utils/random_.py +0 -0
  123. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/utils/requests_.py +0 -0
  124. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/utils/schedule_.py +0 -0
  125. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/utils/tags.py +0 -0
  126. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt/utils/template.py +0 -0
  127. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt.egg-info/dependency_links.txt +0 -0
  128. {vectorbt-1.2.0 → vectorbt-1.2.1}/vectorbt.egg-info/top_level.txt +0 -0
@@ -0,0 +1,2 @@
1
+ prune docs
2
+ recursive-include tests *.py
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vectorbt
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: Python library for backtesting and analyzing trading strategies at scale
5
5
  Author-email: Oleg Polakow <olegpolakow@vectorbt.pro>
6
6
  Project-URL: Homepage, https://github.com/polakowo/vectorbt
@@ -38,7 +38,7 @@ Requires-Dist: requests
38
38
  Requires-Dist: pytz
39
39
  Requires-Dist: mypy_extensions
40
40
  Provides-Extra: rust
41
- Requires-Dist: vectorbt-rust==1.2.0; extra == "rust"
41
+ Requires-Dist: vectorbt-rust==1.2.1; extra == "rust"
42
42
  Provides-Extra: full
43
43
  Requires-Dist: TA-Lib; extra == "full"
44
44
  Requires-Dist: yfinance>=0.2.22; extra == "full"
@@ -124,13 +124,13 @@ Dynamic: license-file
124
124
  <a href="#links">Links</a>
125
125
  </p>
126
126
 
127
- <h3 align="center"><b>Think in matrices. Backtest at scale.</b></h3>
127
+ <h2 align="center">Trading research at scale.</h2>
128
128
 
129
- <p align="center">VectorBT takes a radically different approach to backtesting: instead of looping through bars one strategy at a time, it packs thousands of configurations into NumPy arrays, accelerates the hot path with Numba and Rust, and runs them all at once, turning hours of grid search into seconds.</p>
129
+ <p align="center">VectorBT is a Python toolkit for trading research. Explore market data, build indicators and signals, and compare thousands of ideas across assets and timeframes. NumPy arrays, Numba acceleration, and an optional Rust engine let you run large experiments in a few lines of Python.</p>
130
130
 
131
131
  ---
132
132
 
133
- Explore thousands of trading ideas across assets and timeframes, analyze portfolio performance down to individual trades, and visualize results interactively, all in a few lines of code. Built for both human researchers and AI agents, VectorBT combines large-scale experimentation with a mature, battle-tested backtesting stack refined through years of community use.
133
+ Move from exploring price patterns to evaluating strategies in one workflow. Inspect trades, fees, drawdowns, and portfolio performance, then explore the results with interactive charts. Built for traders, researchers, and AI agents, VectorBT brings data analysis, strategy simulation, and visualization together in a composable Python API.
134
134
 
135
135
  VectorBT is the open-source community edition of [VectorBT PRO](https://vectorbt.pro/).
136
136
  PRO extends the library with parallelization, additional data integrations, portfolio optimization,
@@ -145,62 +145,74 @@ See [VectorBT vs PRO](https://vectorbt.dev/getting-started/upgrade/) or browse
145
145
  <table>
146
146
  <tr>
147
147
  <td width="50%" valign="top">
148
- <p><strong>Fast, vectorized backtesting</strong><br>
149
- Research strategies at scale with pandas, NumPy, and Numba.</p>
148
+ <h3>Fast, vectorized backtesting</h3>
149
+ <p>Research strategies at scale with pandas, NumPy, and Numba.</p>
150
+ <p><a href="https://vectorbt.dev/getting-started/features/#fast-vectorized-backtesting">Backtesting examples →</a></p>
150
151
  </td>
151
152
  <td width="50%" valign="top">
152
- <p><strong>Optional Rust engine</strong><br>
153
- Use precompiled kernels for supported operations without JIT compilation.</p>
153
+ <h3>Optional Rust engine</h3>
154
+ <p>Use precompiled kernels for supported operations without JIT compilation.</p>
155
+ <p><a href="https://vectorbt.dev/getting-started/features/#optional-rust-engine">Rust engine →</a></p>
154
156
  </td>
155
157
  </tr>
156
158
  <tr>
157
159
  <td width="50%" valign="top">
158
- <p><strong>Pandas-native API</strong><br>
159
- Work with custom accessors and high-performance operations directly on pandas objects.</p>
160
+ <h3>Pandas-native API</h3>
161
+ <p>Work with custom accessors and high-performance operations directly on pandas objects.</p>
162
+ <p><a href="https://vectorbt.dev/getting-started/features/#pandas-native-api">Pandas integration →</a></p>
160
163
  </td>
161
164
  <td width="50%" valign="top">
162
- <p><strong>Flexible broadcasting</strong><br>
163
- Analyze multiple assets and sweep large parameter grids with flexible array broadcasting.</p>
165
+ <h3>Flexible broadcasting</h3>
166
+ <p>Analyze multiple assets and sweep large parameter grids with flexible array broadcasting.</p>
167
+ <p><a href="https://vectorbt.dev/getting-started/features/#flexible-broadcasting">Broadcasting API →</a></p>
164
168
  </td>
165
169
  </tr>
166
170
  <tr>
167
171
  <td width="50%" valign="top">
168
- <p><strong>Rich indicator ecosystem</strong><br>
169
- Build custom indicators and use integrations for TA-Lib, Pandas TA, and more.</p>
172
+ <h3>Rich indicator ecosystem</h3>
173
+ <p>Build custom indicators and use integrations for TA-Lib, Pandas TA, and more.</p>
174
+ <p><a href="https://vectorbt.dev/getting-started/features/#rich-indicator-ecosystem">Indicator features →</a></p>
170
175
  </td>
171
176
  <td width="50%" valign="top">
172
- <p><strong>Portfolio backtesting</strong><br>
173
- Analyze trades, drawdowns, and performance, with QuantStats integration.</p>
177
+ <h3>Portfolio backtesting</h3>
178
+ <p>Analyze trades, drawdowns, and performance, with QuantStats integration.</p>
179
+ <p><a href="https://vectorbt.dev/getting-started/features/#portfolio-backtesting">Portfolio analysis →</a></p>
174
180
  </td>
175
181
  </tr>
176
182
  <tr>
177
183
  <td width="50%" valign="top">
178
- <p><strong>Signal tooling</strong><br>
179
- Generate, rank, map, and analyze the distribution of trading signals.</p>
184
+ <h3>Signal tooling</h3>
185
+ <p>Generate, rank, map, and analyze the distribution of trading signals.</p>
186
+ <p><a href="https://vectorbt.dev/getting-started/features/#signal-tooling">Signal features →</a></p>
180
187
  </td>
181
188
  <td width="50%" valign="top">
182
- <p><strong>Built-in data access</strong><br>
183
- Fetch market data, preprocess it, and generate synthetic time series.</p>
189
+ <h3>Built-in data access</h3>
190
+ <p>Fetch market data, preprocess it, and generate synthetic time series.</p>
191
+ <p><a href="https://vectorbt.dev/getting-started/features/#built-in-data-access">Data features →</a></p>
184
192
  </td>
185
193
  </tr>
186
194
  <tr>
187
195
  <td width="50%" valign="top">
188
- <p><strong>Robustness testing</strong><br>
189
- Run walk-forward optimization and generate labels for machine learning workflows.</p>
196
+ <h3>Robustness testing</h3>
197
+ <p>Run walk-forward optimization and generate labels for machine learning workflows.</p>
198
+ <p><a href="https://vectorbt.dev/getting-started/features/#robustness-testing">Robustness testing →</a></p>
190
199
  </td>
191
200
  <td width="50%" valign="top">
192
- <p><strong>Interactive visualization</strong><br>
193
- Explore results with Plotly charts, Jupyter widgets, and browser dashboards.</p>
201
+ <h3>Interactive visualization</h3>
202
+ <p>Explore results with Plotly charts, Jupyter widgets, and browser dashboards.</p>
203
+ <p><a href="https://vectorbt.dev/getting-started/features/#interactive-visualization">Plotting features →</a></p>
194
204
  </td>
195
205
  </tr>
196
206
  <tr>
197
207
  <td width="50%" valign="top">
198
- <p><strong>Automation tools</strong><br>
199
- Schedule data updates and send Telegram notifications.</p>
208
+ <h3>Automation tools</h3>
209
+ <p>Schedule data updates and send Telegram notifications.</p>
210
+ <p><a href="https://vectorbt.dev/getting-started/features/#automation-tools">Scheduling and notifications →</a></p>
200
211
  </td>
201
212
  <td width="50%" valign="top">
202
- <p><strong>Composable Python API</strong><br>
203
- Combine building blocks for rapid experimentation and AI agent-driven workflows.</p>
213
+ <h3>Composable Python API</h3>
214
+ <p>Combine building blocks for rapid experimentation and AI agent-driven workflows.</p>
215
+ <p><a href="https://vectorbt.dev/getting-started/features/#composable-python-api">Python workflows →</a></p>
204
216
  </td>
205
217
  </tr>
206
218
  </table>
@@ -243,7 +255,9 @@ pf = vbt.Portfolio.from_holding(price, init_cash=100)
243
255
  print(pf.total_profit())
244
256
  ```
245
257
 
246
- ```plaintext
258
+ Output:
259
+
260
+ ```text
247
261
  19501.10906763755
248
262
  ```
249
263
 
@@ -259,7 +273,9 @@ pf = vbt.Portfolio.from_signals(price, entries, exits, init_cash=100)
259
273
  print(pf.total_profit())
260
274
  ```
261
275
 
262
- ```plaintext
276
+ Output:
277
+
278
+ ```text
263
279
  34417.80960086067
264
280
  ```
265
281
 
@@ -287,7 +303,9 @@ fig = mean_expectancy.unstack().vbt.scatterplot(xaxis_title="randnx_n", yaxis_ti
287
303
  fig.show()
288
304
  ```
289
305
 
290
- <img width="750" src="https://raw.githubusercontent.com/polakowo/vectorbt/master/docs/docs/assets/images/readme-scatter.gif" alt="Hovering and zooming into random-strategy results" />
306
+ Output:
307
+
308
+ <img width="750" src="https://raw.githubusercontent.com/polakowo/vectorbt/master/docs/docs/assets/images/usage_rand_scatter.svg" alt="Random-strategy mean trade expectancy" />
291
309
 
292
310
  ### Test 10,000 dual-SMA window combinations
293
311
 
@@ -304,12 +322,18 @@ exits = fast_ma.ma_crossed_below(slow_ma)
304
322
  pf = vbt.Portfolio.from_signals(price, entries, exits, size=np.inf, fees=0.001, freq="1D")
305
323
 
306
324
  fig = pf.total_return().vbt.heatmap(
307
- x_level="fast_window", y_level="slow_window", slider_level="symbol", symmetric=True,
308
- trace_kwargs=dict(colorbar=dict(title="Total return", tickformat="%")))
325
+ x_level="fast_window",
326
+ y_level="slow_window",
327
+ slider_level="symbol",
328
+ symmetric=True,
329
+ trace_kwargs=dict(colorbar=dict(title="Total return", tickformat="%")),
330
+ )
309
331
  fig.show()
310
332
  ```
311
333
 
312
- <img width="750" src="https://raw.githubusercontent.com/polakowo/vectorbt/master/docs/docs/assets/images/readme-heatmap.gif" alt="Switching assets and inspecting dual-SMA parameter returns" />
334
+ Output:
335
+
336
+ <img width="750" src="https://raw.githubusercontent.com/polakowo/vectorbt/master/docs/docs/assets/images/usage_dmac_heatmap.gif" alt="Dual-SMA window combinations across assets" />
313
337
 
314
338
  > [!TIP]
315
339
  > **VectorBT PRO**
@@ -326,7 +350,9 @@ fig.show()
326
350
  print(pf[(10, 20, "ETH-USD")].stats())
327
351
  ```
328
352
 
329
- ```plaintext
353
+ Output:
354
+
355
+ ```text
330
356
  Start 2017-11-09 00:00:00+00:00
331
357
  End 2026-01-03 00:00:00+00:00
332
358
  Period 2978 days 00:00:00
@@ -364,6 +390,8 @@ Name: (10, 20, ETH-USD), dtype: object
364
390
  pf[(10, 20, "ETH-USD")].plot().show()
365
391
  ```
366
392
 
393
+ Output:
394
+
367
395
  <img width="750" src="https://raw.githubusercontent.com/polakowo/vectorbt/master/docs/docs/assets/images/readme-portfolio.gif" alt="Inspecting trades, zooming, and toggling the portfolio benchmark" />
368
396
 
369
397
  ### Animate Bollinger Bands across multiple symbols
@@ -376,30 +404,44 @@ data = vbt.YFData.download(symbols, period="6mo", missing_index="drop")
376
404
  price = data.get("Close")
377
405
  bbands = vbt.BBANDS.run(price)
378
406
 
407
+
379
408
  def plot(index, bbands):
380
409
  bbands = bbands.loc[index]
381
410
  fig = vbt.make_subplots(
382
- rows=2, cols=1, shared_xaxes=True, vertical_spacing=0.15,
383
- subplot_titles=("%B", "Bandwidth"))
411
+ rows=2, cols=1, shared_xaxes=True, vertical_spacing=0.15, subplot_titles=("%B", "Bandwidth")
412
+ )
384
413
  fig.update_layout(showlegend=False, width=750, height=400)
385
414
  bbands.percent_b.vbt.ts_heatmap(
386
- trace_kwargs=dict(zmin=0, zmid=0.5, zmax=1, colorscale="Spectral", colorbar=dict(
387
- y=(fig.layout.yaxis.domain[0] + fig.layout.yaxis.domain[1]) / 2, len=0.5
388
- )), add_trace_kwargs=dict(row=1, col=1), fig=fig)
415
+ trace_kwargs=dict(
416
+ zmin=0,
417
+ zmid=0.5,
418
+ zmax=1,
419
+ colorscale="Spectral",
420
+ colorbar=dict(y=(fig.layout.yaxis.domain[0] + fig.layout.yaxis.domain[1]) / 2, len=0.5),
421
+ ),
422
+ add_trace_kwargs=dict(row=1, col=1),
423
+ fig=fig,
424
+ )
389
425
  bbands.bandwidth.vbt.ts_heatmap(
390
- trace_kwargs=dict(colorbar=dict(
391
- y=(fig.layout.yaxis2.domain[0] + fig.layout.yaxis2.domain[1]) / 2, len=0.5
392
- )), add_trace_kwargs=dict(row=2, col=1), fig=fig)
426
+ trace_kwargs=dict(colorbar=dict(y=(fig.layout.yaxis2.domain[0] + fig.layout.yaxis2.domain[1]) / 2, len=0.5)),
427
+ add_trace_kwargs=dict(row=2, col=1),
428
+ fig=fig,
429
+ )
393
430
  return fig
394
431
 
395
- vbt.save_animation("bbands.gif", bbands.wrapper.index, plot, bbands, delta=90, step=3, fps=3)
432
+
433
+ vbt.save_animation(
434
+ "bbands.gif", bbands.wrapper.index, plot, bbands, delta=90, step=3, fps=3, writer_kwargs=dict(loop=0)
435
+ )
396
436
  ```
397
437
 
398
- ```plaintext
438
+ Output:
439
+
440
+ ```text
399
441
  100%|██████████| 31/31 [00:21<00:00, 1.21it/s]
400
442
  ```
401
443
 
402
- <img width="750" src="https://raw.githubusercontent.com/polakowo/vectorbt/master/docs/docs/assets/images/readme-bbands.gif" alt="Inspecting Bollinger Bands and playing the rolling-window animation" />
444
+ <img width="750" src="https://raw.githubusercontent.com/polakowo/vectorbt/master/docs/docs/assets/images/usage_bbands.gif" alt="Rolling Bollinger Bands percent-B and bandwidth heatmaps" />
403
445
 
404
446
  Visit the [website](https://vectorbt.dev/) for more examples, documentation, and guides.
405
447
 
@@ -52,13 +52,13 @@
52
52
  <a href="#links">Links</a>
53
53
  </p>
54
54
 
55
- <h3 align="center"><b>Think in matrices. Backtest at scale.</b></h3>
55
+ <h2 align="center">Trading research at scale.</h2>
56
56
 
57
- <p align="center">VectorBT takes a radically different approach to backtesting: instead of looping through bars one strategy at a time, it packs thousands of configurations into NumPy arrays, accelerates the hot path with Numba and Rust, and runs them all at once, turning hours of grid search into seconds.</p>
57
+ <p align="center">VectorBT is a Python toolkit for trading research. Explore market data, build indicators and signals, and compare thousands of ideas across assets and timeframes. NumPy arrays, Numba acceleration, and an optional Rust engine let you run large experiments in a few lines of Python.</p>
58
58
 
59
59
  ---
60
60
 
61
- Explore thousands of trading ideas across assets and timeframes, analyze portfolio performance down to individual trades, and visualize results interactively, all in a few lines of code. Built for both human researchers and AI agents, VectorBT combines large-scale experimentation with a mature, battle-tested backtesting stack refined through years of community use.
61
+ Move from exploring price patterns to evaluating strategies in one workflow. Inspect trades, fees, drawdowns, and portfolio performance, then explore the results with interactive charts. Built for traders, researchers, and AI agents, VectorBT brings data analysis, strategy simulation, and visualization together in a composable Python API.
62
62
 
63
63
  VectorBT is the open-source community edition of [VectorBT PRO](https://vectorbt.pro/).
64
64
  PRO extends the library with parallelization, additional data integrations, portfolio optimization,
@@ -73,62 +73,74 @@ See [VectorBT vs PRO](https://vectorbt.dev/getting-started/upgrade/) or browse
73
73
  <table>
74
74
  <tr>
75
75
  <td width="50%" valign="top">
76
- <p><strong>Fast, vectorized backtesting</strong><br>
77
- Research strategies at scale with pandas, NumPy, and Numba.</p>
76
+ <h3>Fast, vectorized backtesting</h3>
77
+ <p>Research strategies at scale with pandas, NumPy, and Numba.</p>
78
+ <p><a href="https://vectorbt.dev/getting-started/features/#fast-vectorized-backtesting">Backtesting examples →</a></p>
78
79
  </td>
79
80
  <td width="50%" valign="top">
80
- <p><strong>Optional Rust engine</strong><br>
81
- Use precompiled kernels for supported operations without JIT compilation.</p>
81
+ <h3>Optional Rust engine</h3>
82
+ <p>Use precompiled kernels for supported operations without JIT compilation.</p>
83
+ <p><a href="https://vectorbt.dev/getting-started/features/#optional-rust-engine">Rust engine →</a></p>
82
84
  </td>
83
85
  </tr>
84
86
  <tr>
85
87
  <td width="50%" valign="top">
86
- <p><strong>Pandas-native API</strong><br>
87
- Work with custom accessors and high-performance operations directly on pandas objects.</p>
88
+ <h3>Pandas-native API</h3>
89
+ <p>Work with custom accessors and high-performance operations directly on pandas objects.</p>
90
+ <p><a href="https://vectorbt.dev/getting-started/features/#pandas-native-api">Pandas integration →</a></p>
88
91
  </td>
89
92
  <td width="50%" valign="top">
90
- <p><strong>Flexible broadcasting</strong><br>
91
- Analyze multiple assets and sweep large parameter grids with flexible array broadcasting.</p>
93
+ <h3>Flexible broadcasting</h3>
94
+ <p>Analyze multiple assets and sweep large parameter grids with flexible array broadcasting.</p>
95
+ <p><a href="https://vectorbt.dev/getting-started/features/#flexible-broadcasting">Broadcasting API →</a></p>
92
96
  </td>
93
97
  </tr>
94
98
  <tr>
95
99
  <td width="50%" valign="top">
96
- <p><strong>Rich indicator ecosystem</strong><br>
97
- Build custom indicators and use integrations for TA-Lib, Pandas TA, and more.</p>
100
+ <h3>Rich indicator ecosystem</h3>
101
+ <p>Build custom indicators and use integrations for TA-Lib, Pandas TA, and more.</p>
102
+ <p><a href="https://vectorbt.dev/getting-started/features/#rich-indicator-ecosystem">Indicator features →</a></p>
98
103
  </td>
99
104
  <td width="50%" valign="top">
100
- <p><strong>Portfolio backtesting</strong><br>
101
- Analyze trades, drawdowns, and performance, with QuantStats integration.</p>
105
+ <h3>Portfolio backtesting</h3>
106
+ <p>Analyze trades, drawdowns, and performance, with QuantStats integration.</p>
107
+ <p><a href="https://vectorbt.dev/getting-started/features/#portfolio-backtesting">Portfolio analysis →</a></p>
102
108
  </td>
103
109
  </tr>
104
110
  <tr>
105
111
  <td width="50%" valign="top">
106
- <p><strong>Signal tooling</strong><br>
107
- Generate, rank, map, and analyze the distribution of trading signals.</p>
112
+ <h3>Signal tooling</h3>
113
+ <p>Generate, rank, map, and analyze the distribution of trading signals.</p>
114
+ <p><a href="https://vectorbt.dev/getting-started/features/#signal-tooling">Signal features →</a></p>
108
115
  </td>
109
116
  <td width="50%" valign="top">
110
- <p><strong>Built-in data access</strong><br>
111
- Fetch market data, preprocess it, and generate synthetic time series.</p>
117
+ <h3>Built-in data access</h3>
118
+ <p>Fetch market data, preprocess it, and generate synthetic time series.</p>
119
+ <p><a href="https://vectorbt.dev/getting-started/features/#built-in-data-access">Data features →</a></p>
112
120
  </td>
113
121
  </tr>
114
122
  <tr>
115
123
  <td width="50%" valign="top">
116
- <p><strong>Robustness testing</strong><br>
117
- Run walk-forward optimization and generate labels for machine learning workflows.</p>
124
+ <h3>Robustness testing</h3>
125
+ <p>Run walk-forward optimization and generate labels for machine learning workflows.</p>
126
+ <p><a href="https://vectorbt.dev/getting-started/features/#robustness-testing">Robustness testing →</a></p>
118
127
  </td>
119
128
  <td width="50%" valign="top">
120
- <p><strong>Interactive visualization</strong><br>
121
- Explore results with Plotly charts, Jupyter widgets, and browser dashboards.</p>
129
+ <h3>Interactive visualization</h3>
130
+ <p>Explore results with Plotly charts, Jupyter widgets, and browser dashboards.</p>
131
+ <p><a href="https://vectorbt.dev/getting-started/features/#interactive-visualization">Plotting features →</a></p>
122
132
  </td>
123
133
  </tr>
124
134
  <tr>
125
135
  <td width="50%" valign="top">
126
- <p><strong>Automation tools</strong><br>
127
- Schedule data updates and send Telegram notifications.</p>
136
+ <h3>Automation tools</h3>
137
+ <p>Schedule data updates and send Telegram notifications.</p>
138
+ <p><a href="https://vectorbt.dev/getting-started/features/#automation-tools">Scheduling and notifications →</a></p>
128
139
  </td>
129
140
  <td width="50%" valign="top">
130
- <p><strong>Composable Python API</strong><br>
131
- Combine building blocks for rapid experimentation and AI agent-driven workflows.</p>
141
+ <h3>Composable Python API</h3>
142
+ <p>Combine building blocks for rapid experimentation and AI agent-driven workflows.</p>
143
+ <p><a href="https://vectorbt.dev/getting-started/features/#composable-python-api">Python workflows →</a></p>
132
144
  </td>
133
145
  </tr>
134
146
  </table>
@@ -171,7 +183,9 @@ pf = vbt.Portfolio.from_holding(price, init_cash=100)
171
183
  print(pf.total_profit())
172
184
  ```
173
185
 
174
- ```plaintext
186
+ Output:
187
+
188
+ ```text
175
189
  19501.10906763755
176
190
  ```
177
191
 
@@ -187,7 +201,9 @@ pf = vbt.Portfolio.from_signals(price, entries, exits, init_cash=100)
187
201
  print(pf.total_profit())
188
202
  ```
189
203
 
190
- ```plaintext
204
+ Output:
205
+
206
+ ```text
191
207
  34417.80960086067
192
208
  ```
193
209
 
@@ -215,7 +231,9 @@ fig = mean_expectancy.unstack().vbt.scatterplot(xaxis_title="randnx_n", yaxis_ti
215
231
  fig.show()
216
232
  ```
217
233
 
218
- <img width="750" src="https://raw.githubusercontent.com/polakowo/vectorbt/master/docs/docs/assets/images/readme-scatter.gif" alt="Hovering and zooming into random-strategy results" />
234
+ Output:
235
+
236
+ <img width="750" src="https://raw.githubusercontent.com/polakowo/vectorbt/master/docs/docs/assets/images/usage_rand_scatter.svg" alt="Random-strategy mean trade expectancy" />
219
237
 
220
238
  ### Test 10,000 dual-SMA window combinations
221
239
 
@@ -232,12 +250,18 @@ exits = fast_ma.ma_crossed_below(slow_ma)
232
250
  pf = vbt.Portfolio.from_signals(price, entries, exits, size=np.inf, fees=0.001, freq="1D")
233
251
 
234
252
  fig = pf.total_return().vbt.heatmap(
235
- x_level="fast_window", y_level="slow_window", slider_level="symbol", symmetric=True,
236
- trace_kwargs=dict(colorbar=dict(title="Total return", tickformat="%")))
253
+ x_level="fast_window",
254
+ y_level="slow_window",
255
+ slider_level="symbol",
256
+ symmetric=True,
257
+ trace_kwargs=dict(colorbar=dict(title="Total return", tickformat="%")),
258
+ )
237
259
  fig.show()
238
260
  ```
239
261
 
240
- <img width="750" src="https://raw.githubusercontent.com/polakowo/vectorbt/master/docs/docs/assets/images/readme-heatmap.gif" alt="Switching assets and inspecting dual-SMA parameter returns" />
262
+ Output:
263
+
264
+ <img width="750" src="https://raw.githubusercontent.com/polakowo/vectorbt/master/docs/docs/assets/images/usage_dmac_heatmap.gif" alt="Dual-SMA window combinations across assets" />
241
265
 
242
266
  > [!TIP]
243
267
  > **VectorBT PRO**
@@ -254,7 +278,9 @@ fig.show()
254
278
  print(pf[(10, 20, "ETH-USD")].stats())
255
279
  ```
256
280
 
257
- ```plaintext
281
+ Output:
282
+
283
+ ```text
258
284
  Start 2017-11-09 00:00:00+00:00
259
285
  End 2026-01-03 00:00:00+00:00
260
286
  Period 2978 days 00:00:00
@@ -292,6 +318,8 @@ Name: (10, 20, ETH-USD), dtype: object
292
318
  pf[(10, 20, "ETH-USD")].plot().show()
293
319
  ```
294
320
 
321
+ Output:
322
+
295
323
  <img width="750" src="https://raw.githubusercontent.com/polakowo/vectorbt/master/docs/docs/assets/images/readme-portfolio.gif" alt="Inspecting trades, zooming, and toggling the portfolio benchmark" />
296
324
 
297
325
  ### Animate Bollinger Bands across multiple symbols
@@ -304,30 +332,44 @@ data = vbt.YFData.download(symbols, period="6mo", missing_index="drop")
304
332
  price = data.get("Close")
305
333
  bbands = vbt.BBANDS.run(price)
306
334
 
335
+
307
336
  def plot(index, bbands):
308
337
  bbands = bbands.loc[index]
309
338
  fig = vbt.make_subplots(
310
- rows=2, cols=1, shared_xaxes=True, vertical_spacing=0.15,
311
- subplot_titles=("%B", "Bandwidth"))
339
+ rows=2, cols=1, shared_xaxes=True, vertical_spacing=0.15, subplot_titles=("%B", "Bandwidth")
340
+ )
312
341
  fig.update_layout(showlegend=False, width=750, height=400)
313
342
  bbands.percent_b.vbt.ts_heatmap(
314
- trace_kwargs=dict(zmin=0, zmid=0.5, zmax=1, colorscale="Spectral", colorbar=dict(
315
- y=(fig.layout.yaxis.domain[0] + fig.layout.yaxis.domain[1]) / 2, len=0.5
316
- )), add_trace_kwargs=dict(row=1, col=1), fig=fig)
343
+ trace_kwargs=dict(
344
+ zmin=0,
345
+ zmid=0.5,
346
+ zmax=1,
347
+ colorscale="Spectral",
348
+ colorbar=dict(y=(fig.layout.yaxis.domain[0] + fig.layout.yaxis.domain[1]) / 2, len=0.5),
349
+ ),
350
+ add_trace_kwargs=dict(row=1, col=1),
351
+ fig=fig,
352
+ )
317
353
  bbands.bandwidth.vbt.ts_heatmap(
318
- trace_kwargs=dict(colorbar=dict(
319
- y=(fig.layout.yaxis2.domain[0] + fig.layout.yaxis2.domain[1]) / 2, len=0.5
320
- )), add_trace_kwargs=dict(row=2, col=1), fig=fig)
354
+ trace_kwargs=dict(colorbar=dict(y=(fig.layout.yaxis2.domain[0] + fig.layout.yaxis2.domain[1]) / 2, len=0.5)),
355
+ add_trace_kwargs=dict(row=2, col=1),
356
+ fig=fig,
357
+ )
321
358
  return fig
322
359
 
323
- vbt.save_animation("bbands.gif", bbands.wrapper.index, plot, bbands, delta=90, step=3, fps=3)
360
+
361
+ vbt.save_animation(
362
+ "bbands.gif", bbands.wrapper.index, plot, bbands, delta=90, step=3, fps=3, writer_kwargs=dict(loop=0)
363
+ )
324
364
  ```
325
365
 
326
- ```plaintext
366
+ Output:
367
+
368
+ ```text
327
369
  100%|██████████| 31/31 [00:21<00:00, 1.21it/s]
328
370
  ```
329
371
 
330
- <img width="750" src="https://raw.githubusercontent.com/polakowo/vectorbt/master/docs/docs/assets/images/readme-bbands.gif" alt="Inspecting Bollinger Bands and playing the rolling-window animation" />
372
+ <img width="750" src="https://raw.githubusercontent.com/polakowo/vectorbt/master/docs/docs/assets/images/usage_bbands.gif" alt="Rolling Bollinger Bands percent-B and bandwidth heatmaps" />
331
373
 
332
374
  Visit the [website](https://vectorbt.dev/) for more examples, documentation, and guides.
333
375
 
@@ -49,7 +49,7 @@ dependencies = [
49
49
 
50
50
  [project.optional-dependencies]
51
51
  rust = [
52
- "vectorbt-rust==1.2.0",
52
+ "vectorbt-rust==1.2.1",
53
53
  ]
54
54
  full = [
55
55
  "TA-Lib",
File without changes