vectorbt 0.28.4__tar.gz → 1.0.0__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 (137) hide show
  1. vectorbt-1.0.0/MANIFEST.in +1 -0
  2. {vectorbt-0.28.4 → vectorbt-1.0.0}/PKG-INFO +96 -46
  3. {vectorbt-0.28.4 → vectorbt-1.0.0}/README.md +72 -29
  4. {vectorbt-0.28.4 → vectorbt-1.0.0}/pyproject.toml +26 -12
  5. vectorbt-1.0.0/setup.py +9 -0
  6. {vectorbt-0.28.4 → vectorbt-1.0.0}/tests/test_base.py +1072 -1618
  7. vectorbt-1.0.0/tests/test_data.py +1002 -0
  8. vectorbt-1.0.0/tests/test_engine.py +2435 -0
  9. vectorbt-1.0.0/tests/test_generic.py +1591 -0
  10. vectorbt-1.0.0/tests/test_indicators.py +3212 -0
  11. vectorbt-1.0.0/tests/test_labels.py +508 -0
  12. vectorbt-1.0.0/tests/test_plotting.py +1424 -0
  13. vectorbt-1.0.0/tests/test_portfolio.py +10754 -0
  14. vectorbt-1.0.0/tests/test_records.py +4680 -0
  15. {vectorbt-0.28.4 → vectorbt-1.0.0}/tests/test_returns.py +350 -372
  16. {vectorbt-0.28.4 → vectorbt-1.0.0}/tests/test_settings.py +3 -1
  17. vectorbt-1.0.0/tests/test_signals.py +4090 -0
  18. {vectorbt-0.28.4 → vectorbt-1.0.0}/tests/test_utils.py +742 -857
  19. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/__init__.py +3 -2
  20. vectorbt-1.0.0/vectorbt/_engine.py +370 -0
  21. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/_settings.py +127 -236
  22. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/_typing.py +1 -1
  23. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/_version.py +2 -2
  24. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/base/__init__.py +2 -4
  25. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/base/accessors.py +128 -56
  26. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/base/array_wrapper.py +140 -103
  27. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/base/column_grouper.py +28 -15
  28. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/base/combine_fns.py +47 -38
  29. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/base/index_fns.py +41 -31
  30. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/base/indexing.py +23 -12
  31. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/base/reshape_fns.py +92 -64
  32. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/data/__init__.py +10 -10
  33. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/data/base.py +96 -120
  34. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/data/custom.py +189 -186
  35. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/data/updater.py +11 -9
  36. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/generic/__init__.py +2 -8
  37. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/generic/accessors.py +970 -613
  38. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/generic/decorators.py +33 -25
  39. vectorbt-1.0.0/vectorbt/generic/dispatch.py +1953 -0
  40. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/generic/drawdowns.py +349 -317
  41. vectorbt-1.0.0/vectorbt/generic/enums.py +97 -0
  42. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/generic/nb.py +146 -107
  43. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/generic/plots_builder.py +149 -163
  44. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/generic/plotting.py +130 -176
  45. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/generic/ranges.py +210 -216
  46. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/generic/splitters.py +27 -25
  47. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/generic/stats_builder.py +114 -121
  48. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/indicators/__init__.py +4 -30
  49. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/indicators/basic.py +257 -285
  50. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/indicators/configs.py +3 -7
  51. vectorbt-1.0.0/vectorbt/indicators/dispatch.py +461 -0
  52. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/indicators/factory.py +514 -486
  53. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/indicators/nb.py +124 -40
  54. vectorbt-1.0.0/vectorbt/labels/__init__.py +11 -0
  55. vectorbt-1.0.0/vectorbt/labels/dispatch.py +371 -0
  56. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/labels/enums.py +5 -5
  57. vectorbt-1.0.0/vectorbt/labels/generators.py +181 -0
  58. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/labels/nb.py +43 -41
  59. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/messaging/__init__.py +5 -4
  60. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/messaging/telegram.py +29 -31
  61. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/ohlcv_accessors.py +98 -117
  62. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/portfolio/__init__.py +2 -10
  63. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/portfolio/base.py +1319 -1079
  64. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/portfolio/decorators.py +16 -14
  65. vectorbt-1.0.0/vectorbt/portfolio/dispatch.py +1922 -0
  66. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/portfolio/enums.py +452 -270
  67. vectorbt-1.0.0/vectorbt/portfolio/logs.py +253 -0
  68. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/portfolio/nb.py +1464 -984
  69. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/portfolio/orders.py +106 -218
  70. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/portfolio/trades.py +420 -530
  71. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/px_accessors.py +27 -21
  72. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/records/__init__.py +2 -5
  73. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/records/base.py +128 -137
  74. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/records/col_mapper.py +28 -21
  75. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/records/decorators.py +29 -28
  76. vectorbt-1.0.0/vectorbt/records/dispatch.py +397 -0
  77. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/records/mapped_array.py +279 -275
  78. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/records/nb.py +70 -36
  79. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/returns/__init__.py +2 -2
  80. vectorbt-1.0.0/vectorbt/returns/accessors.py +1481 -0
  81. vectorbt-1.0.0/vectorbt/returns/dispatch.py +1060 -0
  82. vectorbt-1.0.0/vectorbt/returns/metrics.py +36 -0
  83. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/returns/nb.py +183 -184
  84. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/returns/qs_adapter.py +27 -28
  85. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/root_accessors.py +1 -1
  86. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/signals/__init__.py +14 -14
  87. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/signals/accessors.py +604 -426
  88. vectorbt-1.0.0/vectorbt/signals/dispatch.py +1215 -0
  89. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/signals/enums.py +8 -7
  90. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/signals/factory.py +188 -147
  91. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/signals/generators.py +145 -221
  92. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/signals/nb.py +280 -234
  93. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/utils/__init__.py +24 -24
  94. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/utils/array_.py +9 -6
  95. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/utils/attr_.py +48 -56
  96. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/utils/checks.py +98 -37
  97. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/utils/colors.py +3 -3
  98. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/utils/config.py +130 -138
  99. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/utils/datetime_.py +14 -11
  100. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/utils/decorators.py +76 -70
  101. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/utils/docs.py +4 -7
  102. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/utils/enum_.py +1 -1
  103. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/utils/figure.py +22 -17
  104. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/utils/image_.py +18 -16
  105. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/utils/mapping.py +27 -22
  106. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/utils/math_.py +3 -3
  107. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/utils/module_.py +21 -11
  108. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/utils/params.py +1 -1
  109. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/utils/random_.py +1 -1
  110. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/utils/requests_.py +15 -15
  111. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/utils/schedule_.py +20 -21
  112. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/utils/tags.py +1 -1
  113. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/utils/template.py +19 -17
  114. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt.egg-info/PKG-INFO +96 -46
  115. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt.egg-info/SOURCES.txt +11 -0
  116. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt.egg-info/requires.txt +25 -14
  117. vectorbt-0.28.4/setup.py +0 -3
  118. vectorbt-0.28.4/tests/test_data.py +0 -1066
  119. vectorbt-0.28.4/tests/test_generic.py +0 -1843
  120. vectorbt-0.28.4/tests/test_indicators.py +0 -3031
  121. vectorbt-0.28.4/tests/test_labels.py +0 -413
  122. vectorbt-0.28.4/tests/test_portfolio.py +0 -7557
  123. vectorbt-0.28.4/tests/test_records.py +0 -3571
  124. vectorbt-0.28.4/tests/test_signals.py +0 -3158
  125. vectorbt-0.28.4/vectorbt/generic/enums.py +0 -93
  126. vectorbt-0.28.4/vectorbt/labels/__init__.py +0 -31
  127. vectorbt-0.28.4/vectorbt/labels/generators.py +0 -213
  128. vectorbt-0.28.4/vectorbt/portfolio/logs.py +0 -359
  129. vectorbt-0.28.4/vectorbt/returns/accessors.py +0 -1263
  130. vectorbt-0.28.4/vectorbt/returns/metrics.py +0 -26
  131. {vectorbt-0.28.4 → vectorbt-1.0.0}/LICENSE.md +0 -0
  132. {vectorbt-0.28.4 → vectorbt-1.0.0}/setup.cfg +0 -0
  133. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/templates/dark.json +0 -0
  134. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/templates/light.json +0 -0
  135. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt/templates/seaborn.json +0 -0
  136. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt.egg-info/dependency_links.txt +0 -0
  137. {vectorbt-0.28.4 → vectorbt-1.0.0}/vectorbt.egg-info/top_level.txt +0 -0
@@ -0,0 +1 @@
1
+ prune docs
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vectorbt
3
- Version: 0.28.4
3
+ Version: 1.0.0
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
@@ -36,17 +36,8 @@ Requires-Dist: schedule
36
36
  Requires-Dist: requests
37
37
  Requires-Dist: pytz
38
38
  Requires-Dist: mypy_extensions
39
- Provides-Extra: full
40
- Requires-Dist: yfinance>=0.2.22; extra == "full"
41
- Requires-Dist: python-binance; extra == "full"
42
- Requires-Dist: ccxt>=4.0.14; extra == "full"
43
- Requires-Dist: alpaca-py; extra == "full"
44
- Requires-Dist: ray>=1.4.1; extra == "full"
45
- Requires-Dist: ta; extra == "full"
46
- Requires-Dist: pandas-ta-classic; extra == "full"
47
- Requires-Dist: TA-Lib; extra == "full"
48
- Requires-Dist: python-telegram-bot<20.0,>=13.4; extra == "full"
49
- Requires-Dist: quantstats>=0.0.37; extra == "full"
39
+ Provides-Extra: rust
40
+ Requires-Dist: vectorbt-rust==1.0.0; extra == "rust"
50
41
  Provides-Extra: full-no-talib
51
42
  Requires-Dist: yfinance>=0.2.22; extra == "full-no-talib"
52
43
  Requires-Dist: python-binance; extra == "full-no-talib"
@@ -57,11 +48,27 @@ Requires-Dist: ta; extra == "full-no-talib"
57
48
  Requires-Dist: pandas-ta-classic; extra == "full-no-talib"
58
49
  Requires-Dist: python-telegram-bot<20.0,>=13.4; extra == "full-no-talib"
59
50
  Requires-Dist: quantstats>=0.0.37; extra == "full-no-talib"
60
- Provides-Extra: cov
61
- Requires-Dist: pytest; extra == "cov"
62
- Requires-Dist: pytest-cov; extra == "cov"
63
- Requires-Dist: pytest-xdist; extra == "cov"
64
- Requires-Dist: codecov; extra == "cov"
51
+ Provides-Extra: full
52
+ Requires-Dist: vectorbt[full-no-talib]; extra == "full"
53
+ Requires-Dist: TA-Lib; extra == "full"
54
+ Provides-Extra: test
55
+ Requires-Dist: pytest; extra == "test"
56
+ Requires-Dist: pytest-cov; extra == "test"
57
+ Requires-Dist: pytest-xdist; extra == "test"
58
+ Requires-Dist: codecov; extra == "test"
59
+ Provides-Extra: test-rust
60
+ Requires-Dist: vectorbt[test]; extra == "test-rust"
61
+ Requires-Dist: maturin<2.0,>=1.7; extra == "test-rust"
62
+ Provides-Extra: docs
63
+ Requires-Dist: mkdocs-material; extra == "docs"
64
+ Requires-Dist: mkdocs-minify-plugin; extra == "docs"
65
+ Requires-Dist: ruamel.yaml; extra == "docs"
66
+ Requires-Dist: mako; extra == "docs"
67
+ Provides-Extra: all
68
+ Requires-Dist: vectorbt[rust]; extra == "all"
69
+ Requires-Dist: vectorbt[full]; extra == "all"
70
+ Requires-Dist: vectorbt[test]; extra == "all"
71
+ Requires-Dist: vectorbt[docs]; extra == "all"
65
72
  Dynamic: license-file
66
73
 
67
74
  <div align="center">
@@ -81,6 +88,15 @@ Dynamic: license-file
81
88
  <a href="https://pepy.tech/project/vectorbt" title="Downloads">
82
89
  <img src="https://pepy.tech/badge/vectorbt" />
83
90
  </a>
91
+ <a href="https://github.com/polakowo/vectorbt/stargazers" title="Stars">
92
+ <img src="https://img.shields.io/github/stars/polakowo/vectorbt?style=flat" />
93
+ </a>
94
+ <a href="https://github.com/polakowo/vectorbt/network/members" title="Forks">
95
+ <img src="https://img.shields.io/github/forks/polakowo/vectorbt?style=flat" />
96
+ </a>
97
+ <a href="https://github.com/polakowo/vectorbt/graphs/contributors" title="Contributors">
98
+ <img src="https://img.shields.io/github/contributors/polakowo/vectorbt?style=flat" />
99
+ </a>
84
100
  <a href="https://pypi.org/project/vectorbt" title="PyPI">
85
101
  <img src="https://img.shields.io/pypi/v/vectorbt?color=blueviolet" />
86
102
  </a>
@@ -99,38 +115,63 @@ Dynamic: license-file
99
115
  <a href="https://gitter.im/vectorbt/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge" title="Join the chat">
100
116
  <img src="https://badges.gitter.im/vectorbt.svg" />
101
117
  </a>
102
- </p>
103
-
104
- <p align="center">
105
118
  <a href="https://pypi.org/project/vectorbt" title="Supported Python versions">
106
119
  <img src="https://img.shields.io/pypi/pyversions/vectorbt.svg?logo=python&logoColor=white" />
107
120
  </a>
108
121
  </p>
109
122
 
110
- > [!TIP]
111
- > *New in 0.28*:
112
- >
113
- > * Plotly 6 support
114
- > * `ticker_kwargs` in `YFData`
115
- > * Fixed Pandas TA dependency (→ [pandas-ta-classic](https://github.com/xgboosted/pandas-ta-classic)).
123
+ <h3 align="center"><b>Thinks in matrices. Backtests at scale.</b></h3>
124
+
125
+ <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>
126
+
127
+ ---
128
+
129
+ 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.
130
+
131
+ VectorBT is the open-source community edition of [VectorBT PRO](https://vectorbt.pro/), a state-of-the-art hybrid backtesting library.
116
132
 
117
- ## :package: Installation
133
+ ## Features
134
+
135
+ - **Fast, vectorized backtesting** and strategy research built on pandas, NumPy, and Numba
136
+ - **Optional Rust engine** for precompiled speed without JIT overhead
137
+ - **Pandas-native API** with custom accessors and high-performance operations
138
+ - **Flexible broadcasting** for multi-asset analysis and large-scale parameter sweeps
139
+ - **Rich indicator ecosystem** with custom indicators and integrations for TA-Lib, Pandas TA, and more
140
+ - **Portfolio backtesting** with trade, drawdown, and performance analytics, including QuantStats integration
141
+ - **Signal tooling** for generation, ranking, mapping, and distribution analysis
142
+ - **Built-in data access** with preprocessing and synthetic data generation
143
+ - **Robustness testing** with walk-forward optimization and label generation for ML workflows
144
+ - **Interactive visualization** with Plotly, Jupyter widgets, and browser-friendly dashboards
145
+ - **Automation tools** for scheduled updates and Telegram notifications
146
+ - **Composable Python API** for rapid experimentation and AI agent-driven workflows
147
+
148
+ ## Installation
118
149
 
119
150
  ```sh
120
151
  pip install -U vectorbt
121
152
  ```
122
153
 
123
- To install optional dependencies as well:
154
+ To install the optional Rust engine:
155
+
156
+ ```sh
157
+ pip install -U "vectorbt[rust]"
158
+ ```
159
+
160
+ To install all optional integrations (TA-Lib, Pandas TA, etc.):
124
161
 
125
162
  ```sh
126
163
  pip install -U "vectorbt[full]"
127
164
  ```
128
165
 
129
- ## :sparkles: Usage
166
+ To install all optional integrations together with the Rust engine:
130
167
 
131
- VectorBT lets you backtest strategies in just a few lines of Python.
168
+ ```sh
169
+ pip install -U "vectorbt[full,rust]"
170
+ ```
171
+
172
+ ## Examples
132
173
 
133
- * Profit from investing $100 in Bitcoin since 2014:
174
+ ### Invest $100 in Bitcoin since 2014
134
175
 
135
176
  ```python
136
177
  import vectorbt as vbt
@@ -146,7 +187,7 @@ print(pf.total_profit())
146
187
  19501.10906763755
147
188
  ```
148
189
 
149
- * Buy when the 10-day SMA crosses above the 50-day SMA, and sell on the opposite crossover:
190
+ ### Trade a dual-SMA crossover strategy
150
191
 
151
192
  ```python
152
193
  fast_ma = vbt.MA.run(price, 10)
@@ -162,7 +203,7 @@ print(pf.total_profit())
162
203
  34417.80960086067
163
204
  ```
164
205
 
165
- * Generate 1,000 strategies with random signals and test them on BTC and ETH:
206
+ ### Generate 1,000 random strategies
166
207
 
167
208
  ```python
168
209
  import numpy as np
@@ -181,7 +222,7 @@ fig.show()
181
222
 
182
223
  ![](https://raw.githubusercontent.com/polakowo/vectorbt/master/docs/docs/assets/images/usage_rand_scatter.svg)
183
224
 
184
- * For hyperparameter optimization fans: test 10,000 window combinations of a dual-SMA crossover strategy on BTC, ETH, and XRP:
225
+ ### Test 10,000 dual-SMA window combinations
185
226
 
186
227
  ```python
187
228
  symbols = ["BTC-USD", "ETH-USD", "XRP-USD"]
@@ -203,7 +244,7 @@ fig.show()
203
244
 
204
245
  <img width="750" src="https://raw.githubusercontent.com/polakowo/vectorbt/master/docs/docs/assets/images/usage_dmac_heatmap.gif">
205
246
 
206
- Inspect any strategy configuration by indexing with pandas:
247
+ ### Inspect any strategy configuration
207
248
 
208
249
  ```python
209
250
  print(pf[(10, 20, "ETH-USD")].stats())
@@ -241,7 +282,7 @@ Sortino Ratio 1.301377
241
282
  Name: (10, 20, ETH-USD), dtype: object
242
283
  ```
243
284
 
244
- Same goes for plotting:
285
+ ### Plot any strategy configuration
245
286
 
246
287
  ```python
247
288
  pf[(10, 20, "ETH-USD")].plot().show()
@@ -249,9 +290,9 @@ pf[(10, 20, "ETH-USD")].plot().show()
249
290
 
250
291
  ![](https://raw.githubusercontent.com/polakowo/vectorbt/master/docs/docs/assets/images/usage_dmac_portfolio.svg)
251
292
 
252
- It's not all about backtesting! VectorBT can also help with financial data analysis and visualization.
293
+ ### Animate Bollinger Bands across multiple symbols
253
294
 
254
- * Create a GIF that animates Bollinger Bands %B and bandwidth across multiple symbols:
295
+ VectorBT goes beyond backtesting, with tools for financial data analysis and visualization:
255
296
 
256
297
  ```python
257
298
  symbols = ["BTC-USD", "ETH-USD", "XRP-USD"]
@@ -284,29 +325,38 @@ vbt.save_animation("bbands.gif", bbands.wrapper.index, plot, bbands, delta=90, s
284
325
 
285
326
  <img width="750" src="https://raw.githubusercontent.com/polakowo/vectorbt/master/docs/docs/assets/images/usage_bbands.gif">
286
327
 
287
- This is just the tip of the iceberg. Visit the [website](https://vectorbt.dev/) to learn more.
328
+ Visit the website[website](https://vectorbt.dev/) for more examples, documentation, and guides.
329
+
330
+ ## Example apps
331
+
332
+ ### [Candlestick Patterns](https://github.com/polakowo/vectorbt/blob/master/apps/candlestick-patterns/)
333
+
334
+ Explore candlestick patterns interactively and backtest their signals with VectorBT.
335
+
336
+ [![teaser.png](https://raw.githubusercontent.com/polakowo/vectorbt/master/apps/candlestick-patterns/assets/teaser.png)](https://github.com/polakowo/vectorbt/blob/master/apps/candlestick-patterns/)
288
337
 
289
- ## :link: Links
338
+ ## Links
290
339
 
291
340
  * [Website](https://vectorbt.dev/)
292
- * [Colab Notebook](https://colab.research.google.com/drive/1ibqyrf6LPFlzRb6mkPpl3hxqL6ryNBXI?usp=sharing)
341
+ * [Docker images](https://hub.docker.com/r/polakowo/vectorbt)
342
+ * [Colab notebook](https://colab.research.google.com/drive/1ibqyrf6LPFlzRb6mkPpl3hxqL6ryNBXI?usp=sharing)
293
343
 
294
- ## :balance_scale: License
344
+ ## License
295
345
 
296
346
  This work is [fair-code](http://faircode.io/) distributed under the [Apache 2.0 with Commons Clause](https://github.com/polakowo/vectorbt/blob/master/LICENSE.md) license.
297
347
 
298
- The source code is open, and everyone (individuals and organizations) may use it for free. However, you may not sell products or services that are primarily this software.
348
+ The source code is publicly available, and everyone (individuals and organizations) may use it for free. However, you may not sell products or services that are primarily this software.
299
349
 
300
350
  If you have questions or want to request a license exception, please [contact the author](mailto:olegpolakow@vectorbt.pro).
301
351
 
302
352
  Installing optional dependencies may be subject to a more restrictive license.
303
353
 
304
- ## :star: Star History
354
+ ## Star history
305
355
 
306
356
  [![Star History Chart](https://api.star-history.com/svg?repos=polakowo/vectorbt&type=Timeline)](https://star-history.com/#polakowo/vectorbt&Timeline)
307
357
 
308
- ## :warning: Disclaimer
358
+ ## Disclaimer
309
359
 
310
360
  This software is for educational purposes only. Do not risk money you cannot afford to lose.
311
361
 
312
- USE THE SOFTWARE AT YOUR OWN RISK. THE AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR TRADING RESULTS.
362
+ Use the software at your own risk. The authors and affiliates assume no responsibility for your trading results.
@@ -15,6 +15,15 @@
15
15
  <a href="https://pepy.tech/project/vectorbt" title="Downloads">
16
16
  <img src="https://pepy.tech/badge/vectorbt" />
17
17
  </a>
18
+ <a href="https://github.com/polakowo/vectorbt/stargazers" title="Stars">
19
+ <img src="https://img.shields.io/github/stars/polakowo/vectorbt?style=flat" />
20
+ </a>
21
+ <a href="https://github.com/polakowo/vectorbt/network/members" title="Forks">
22
+ <img src="https://img.shields.io/github/forks/polakowo/vectorbt?style=flat" />
23
+ </a>
24
+ <a href="https://github.com/polakowo/vectorbt/graphs/contributors" title="Contributors">
25
+ <img src="https://img.shields.io/github/contributors/polakowo/vectorbt?style=flat" />
26
+ </a>
18
27
  <a href="https://pypi.org/project/vectorbt" title="PyPI">
19
28
  <img src="https://img.shields.io/pypi/v/vectorbt?color=blueviolet" />
20
29
  </a>
@@ -33,38 +42,63 @@
33
42
  <a href="https://gitter.im/vectorbt/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge" title="Join the chat">
34
43
  <img src="https://badges.gitter.im/vectorbt.svg" />
35
44
  </a>
36
- </p>
37
-
38
- <p align="center">
39
45
  <a href="https://pypi.org/project/vectorbt" title="Supported Python versions">
40
46
  <img src="https://img.shields.io/pypi/pyversions/vectorbt.svg?logo=python&logoColor=white" />
41
47
  </a>
42
48
  </p>
43
49
 
44
- > [!TIP]
45
- > *New in 0.28*:
46
- >
47
- > * Plotly 6 support
48
- > * `ticker_kwargs` in `YFData`
49
- > * Fixed Pandas TA dependency (→ [pandas-ta-classic](https://github.com/xgboosted/pandas-ta-classic)).
50
+ <h3 align="center"><b>Thinks in matrices. Backtests at scale.</b></h3>
51
+
52
+ <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>
53
+
54
+ ---
55
+
56
+ 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.
57
+
58
+ VectorBT is the open-source community edition of [VectorBT PRO](https://vectorbt.pro/), a state-of-the-art hybrid backtesting library.
59
+
60
+ ## Features
61
+
62
+ - **Fast, vectorized backtesting** and strategy research built on pandas, NumPy, and Numba
63
+ - **Optional Rust engine** for precompiled speed without JIT overhead
64
+ - **Pandas-native API** with custom accessors and high-performance operations
65
+ - **Flexible broadcasting** for multi-asset analysis and large-scale parameter sweeps
66
+ - **Rich indicator ecosystem** with custom indicators and integrations for TA-Lib, Pandas TA, and more
67
+ - **Portfolio backtesting** with trade, drawdown, and performance analytics, including QuantStats integration
68
+ - **Signal tooling** for generation, ranking, mapping, and distribution analysis
69
+ - **Built-in data access** with preprocessing and synthetic data generation
70
+ - **Robustness testing** with walk-forward optimization and label generation for ML workflows
71
+ - **Interactive visualization** with Plotly, Jupyter widgets, and browser-friendly dashboards
72
+ - **Automation tools** for scheduled updates and Telegram notifications
73
+ - **Composable Python API** for rapid experimentation and AI agent-driven workflows
50
74
 
51
- ## :package: Installation
75
+ ## Installation
52
76
 
53
77
  ```sh
54
78
  pip install -U vectorbt
55
79
  ```
56
80
 
57
- To install optional dependencies as well:
81
+ To install the optional Rust engine:
82
+
83
+ ```sh
84
+ pip install -U "vectorbt[rust]"
85
+ ```
86
+
87
+ To install all optional integrations (TA-Lib, Pandas TA, etc.):
58
88
 
59
89
  ```sh
60
90
  pip install -U "vectorbt[full]"
61
91
  ```
62
92
 
63
- ## :sparkles: Usage
93
+ To install all optional integrations together with the Rust engine:
64
94
 
65
- VectorBT lets you backtest strategies in just a few lines of Python.
95
+ ```sh
96
+ pip install -U "vectorbt[full,rust]"
97
+ ```
66
98
 
67
- * Profit from investing $100 in Bitcoin since 2014:
99
+ ## Examples
100
+
101
+ ### Invest $100 in Bitcoin since 2014
68
102
 
69
103
  ```python
70
104
  import vectorbt as vbt
@@ -80,7 +114,7 @@ print(pf.total_profit())
80
114
  19501.10906763755
81
115
  ```
82
116
 
83
- * Buy when the 10-day SMA crosses above the 50-day SMA, and sell on the opposite crossover:
117
+ ### Trade a dual-SMA crossover strategy
84
118
 
85
119
  ```python
86
120
  fast_ma = vbt.MA.run(price, 10)
@@ -96,7 +130,7 @@ print(pf.total_profit())
96
130
  34417.80960086067
97
131
  ```
98
132
 
99
- * Generate 1,000 strategies with random signals and test them on BTC and ETH:
133
+ ### Generate 1,000 random strategies
100
134
 
101
135
  ```python
102
136
  import numpy as np
@@ -115,7 +149,7 @@ fig.show()
115
149
 
116
150
  ![](https://raw.githubusercontent.com/polakowo/vectorbt/master/docs/docs/assets/images/usage_rand_scatter.svg)
117
151
 
118
- * For hyperparameter optimization fans: test 10,000 window combinations of a dual-SMA crossover strategy on BTC, ETH, and XRP:
152
+ ### Test 10,000 dual-SMA window combinations
119
153
 
120
154
  ```python
121
155
  symbols = ["BTC-USD", "ETH-USD", "XRP-USD"]
@@ -137,7 +171,7 @@ fig.show()
137
171
 
138
172
  <img width="750" src="https://raw.githubusercontent.com/polakowo/vectorbt/master/docs/docs/assets/images/usage_dmac_heatmap.gif">
139
173
 
140
- Inspect any strategy configuration by indexing with pandas:
174
+ ### Inspect any strategy configuration
141
175
 
142
176
  ```python
143
177
  print(pf[(10, 20, "ETH-USD")].stats())
@@ -175,7 +209,7 @@ Sortino Ratio 1.301377
175
209
  Name: (10, 20, ETH-USD), dtype: object
176
210
  ```
177
211
 
178
- Same goes for plotting:
212
+ ### Plot any strategy configuration
179
213
 
180
214
  ```python
181
215
  pf[(10, 20, "ETH-USD")].plot().show()
@@ -183,9 +217,9 @@ pf[(10, 20, "ETH-USD")].plot().show()
183
217
 
184
218
  ![](https://raw.githubusercontent.com/polakowo/vectorbt/master/docs/docs/assets/images/usage_dmac_portfolio.svg)
185
219
 
186
- It's not all about backtesting! VectorBT can also help with financial data analysis and visualization.
220
+ ### Animate Bollinger Bands across multiple symbols
187
221
 
188
- * Create a GIF that animates Bollinger Bands %B and bandwidth across multiple symbols:
222
+ VectorBT goes beyond backtesting, with tools for financial data analysis and visualization:
189
223
 
190
224
  ```python
191
225
  symbols = ["BTC-USD", "ETH-USD", "XRP-USD"]
@@ -218,29 +252,38 @@ vbt.save_animation("bbands.gif", bbands.wrapper.index, plot, bbands, delta=90, s
218
252
 
219
253
  <img width="750" src="https://raw.githubusercontent.com/polakowo/vectorbt/master/docs/docs/assets/images/usage_bbands.gif">
220
254
 
221
- This is just the tip of the iceberg. Visit the [website](https://vectorbt.dev/) to learn more.
255
+ Visit the website[website](https://vectorbt.dev/) for more examples, documentation, and guides.
256
+
257
+ ## Example apps
258
+
259
+ ### [Candlestick Patterns](https://github.com/polakowo/vectorbt/blob/master/apps/candlestick-patterns/)
260
+
261
+ Explore candlestick patterns interactively and backtest their signals with VectorBT.
262
+
263
+ [![teaser.png](https://raw.githubusercontent.com/polakowo/vectorbt/master/apps/candlestick-patterns/assets/teaser.png)](https://github.com/polakowo/vectorbt/blob/master/apps/candlestick-patterns/)
222
264
 
223
- ## :link: Links
265
+ ## Links
224
266
 
225
267
  * [Website](https://vectorbt.dev/)
226
- * [Colab Notebook](https://colab.research.google.com/drive/1ibqyrf6LPFlzRb6mkPpl3hxqL6ryNBXI?usp=sharing)
268
+ * [Docker images](https://hub.docker.com/r/polakowo/vectorbt)
269
+ * [Colab notebook](https://colab.research.google.com/drive/1ibqyrf6LPFlzRb6mkPpl3hxqL6ryNBXI?usp=sharing)
227
270
 
228
- ## :balance_scale: License
271
+ ## License
229
272
 
230
273
  This work is [fair-code](http://faircode.io/) distributed under the [Apache 2.0 with Commons Clause](https://github.com/polakowo/vectorbt/blob/master/LICENSE.md) license.
231
274
 
232
- The source code is open, and everyone (individuals and organizations) may use it for free. However, you may not sell products or services that are primarily this software.
275
+ The source code is publicly available, and everyone (individuals and organizations) may use it for free. However, you may not sell products or services that are primarily this software.
233
276
 
234
277
  If you have questions or want to request a license exception, please [contact the author](mailto:olegpolakow@vectorbt.pro).
235
278
 
236
279
  Installing optional dependencies may be subject to a more restrictive license.
237
280
 
238
- ## :star: Star History
281
+ ## Star history
239
282
 
240
283
  [![Star History Chart](https://api.star-history.com/svg?repos=polakowo/vectorbt&type=Timeline)](https://star-history.com/#polakowo/vectorbt&Timeline)
241
284
 
242
- ## :warning: Disclaimer
285
+ ## Disclaimer
243
286
 
244
287
  This software is for educational purposes only. Do not risk money you cannot afford to lose.
245
288
 
246
- USE THE SOFTWARE AT YOUR OWN RISK. THE AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR TRADING RESULTS.
289
+ Use the software at your own risk. The authors and affiliates assume no responsibility for your trading results.
@@ -47,17 +47,8 @@ dependencies = [
47
47
  ]
48
48
 
49
49
  [project.optional-dependencies]
50
- full = [
51
- "yfinance>=0.2.22",
52
- "python-binance",
53
- "ccxt>=4.0.14",
54
- "alpaca-py",
55
- "ray>=1.4.1",
56
- "ta",
57
- "pandas-ta-classic",
58
- "TA-Lib",
59
- "python-telegram-bot>=13.4,<20.0",
60
- "quantstats>=0.0.37",
50
+ rust = [
51
+ "vectorbt-rust==1.0.0",
61
52
  ]
62
53
  full-no-talib = [
63
54
  "yfinance>=0.2.22",
@@ -70,12 +61,32 @@ full-no-talib = [
70
61
  "python-telegram-bot>=13.4,<20.0",
71
62
  "quantstats>=0.0.37",
72
63
  ]
73
- cov = [
64
+ full = [
65
+ "vectorbt[full-no-talib]",
66
+ "TA-Lib",
67
+ ]
68
+ test = [
74
69
  "pytest",
75
70
  "pytest-cov",
76
71
  "pytest-xdist",
77
72
  "codecov",
78
73
  ]
74
+ test-rust = [
75
+ "vectorbt[test]",
76
+ "maturin>=1.7,<2.0",
77
+ ]
78
+ docs = [
79
+ "mkdocs-material",
80
+ "mkdocs-minify-plugin",
81
+ "ruamel.yaml",
82
+ "mako",
83
+ ]
84
+ all = [
85
+ "vectorbt[rust]",
86
+ "vectorbt[full]",
87
+ "vectorbt[test]",
88
+ "vectorbt[docs]",
89
+ ]
79
90
 
80
91
  [project.urls]
81
92
  Homepage = "https://github.com/polakowo/vectorbt"
@@ -88,3 +99,6 @@ include = ["vectorbt*"]
88
99
 
89
100
  [tool.setuptools.package-data]
90
101
  vectorbt = ["templates/*.json"]
102
+
103
+ [tool.black]
104
+ line-length = 120
@@ -0,0 +1,9 @@
1
+ from setuptools import setup
2
+
3
+
4
+ def main():
5
+ setup()
6
+
7
+
8
+ if __name__ == "__main__":
9
+ main()