bbstrader 2.0.4__tar.gz → 2.0.5__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.
- {bbstrader-2.0.4 → bbstrader-2.0.5}/.github/workflows/python.yml +2 -2
- {bbstrader-2.0.4 → bbstrader-2.0.5}/.gitignore +1 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/PKG-INFO +8 -7
- {bbstrader-2.0.4 → bbstrader-2.0.5}/README.md +7 -6
- bbstrader-2.0.5/VERSION.txt +1 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/pyproject.toml +2 -2
- {bbstrader-2.0.4 → bbstrader-2.0.5}/src/CMakeLists.txt +9 -9
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/api/__init__.py +1 -1
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/api/handlers.py +1 -1
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/btengine/backtest.py +358 -358
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/btengine/data.py +737 -737
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/btengine/event.py +229 -229
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/btengine/execution.py +287 -287
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/btengine/performance.py +408 -408
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/btengine/portfolio.py +393 -393
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/btengine/strategy.py +588 -588
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/metatrader/copier.py +1 -1
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/metatrader/trade.py +1 -1
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/models/nlp.py +15 -15
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/trading/strategy.py +3 -2
- {bbstrader-2.0.4/src → bbstrader-2.0.5/src/cpp}/metatrader.cpp +1 -1
- {bbstrader-2.0.4 → bbstrader-2.0.5}/tcopier.iss +2 -2
- {bbstrader-2.0.4 → bbstrader-2.0.5}/tcopier.spec +4 -4
- {bbstrader-2.0.4 → bbstrader-2.0.5}/tests/api/test_metatrader_client.py +1 -1
- bbstrader-2.0.5/uv.lock +2880 -0
- bbstrader-2.0.4/VERSION.txt +0 -1
- {bbstrader-2.0.4 → bbstrader-2.0.5}/.clang-format +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/.clang-tidy +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/.github/workflows/build.yml +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/.readthedocs.yaml +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/CMakeLists.txt +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/LICENSE +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/cmake/Helpers.cmake +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/cmake/Versions.cmake +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/docs/Doxyfile.in +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/docs/Makefile +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/docs/bbstrader.api.rst +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/docs/bbstrader.btengine.rst +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/docs/bbstrader.core.rst +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/docs/bbstrader.metatrader.rst +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/docs/bbstrader.models.rst +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/docs/bbstrader.rst +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/docs/bbstrader.trading.rst +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/docs/conf.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/docs/index.rst +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/docs/make.bat +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/docs/modules.rst +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/docs/requirements.txt +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/examples/strategies.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/include/bbstrader/metatrader.hpp +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/include/bbstrader/objects.hpp +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/__init__.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/__main__.py +0 -0
- /bbstrader-2.0.4/bbstrader/api/metatrader_client.pyi → /bbstrader-2.0.5/src/bbstrader/api/client.pyi +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/assets/bbs_.png +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/assets/bbstrader.ico +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/assets/bbstrader.png +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/assets/qs_metrics_1.png +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/btengine/__init__.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/compat.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/config.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/core/__init__.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/core/data.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/core/strategy.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/metatrader/__init__.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/metatrader/_copier.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/metatrader/account.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/metatrader/broker.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/metatrader/rates.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/metatrader/risk.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/metatrader/utils.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/models/__init__.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/models/optimization.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/scripts.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/trading/__init__.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/trading/execution.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5/src}/bbstrader/trading/utils.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/src/cmake/BbstraderConfig.cmake.in +0 -0
- {bbstrader-2.0.4/src → bbstrader-2.0.5/src/cpp}/bbstrader.cpp +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/tests/CMakeLists.txt +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/tests/__init__.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/tests/api/__init__.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/tests/btengine/__init__.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/tests/btengine/test_backtest.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/tests/btengine/test_data.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/tests/btengine/test_events.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/tests/btengine/test_execution.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/tests/btengine/test_portfolio.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/tests/cpp/test_metatrader_client.cpp +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/tests/metatrader/__init__.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/tests/metatrader/test_account.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/tests/metatrader/test_rates.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/tests/metatrader/test_risk_management.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/tests/metatrader/test_trade.py +0 -0
- {bbstrader-2.0.4 → bbstrader-2.0.5}/vcpkg.json +0 -0
|
@@ -107,7 +107,7 @@ jobs:
|
|
|
107
107
|
|
|
108
108
|
|
|
109
109
|
publish:
|
|
110
|
-
needs: [build_wheels, build_sdist]
|
|
110
|
+
needs: [build_wheels, build_sdist, build_installer]
|
|
111
111
|
runs-on: ubuntu-latest
|
|
112
112
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
|
113
113
|
steps:
|
|
@@ -125,7 +125,7 @@ jobs:
|
|
|
125
125
|
|
|
126
126
|
release:
|
|
127
127
|
name: Create GitHub Release
|
|
128
|
-
needs: [
|
|
128
|
+
needs: [publish]
|
|
129
129
|
runs-on: ubuntu-latest
|
|
130
130
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
|
131
131
|
permissions:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bbstrader
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.5
|
|
4
4
|
Summary: Simplified Investment & Trading Toolkit with Python & C++
|
|
5
5
|
Keywords: Finance,Toolkit,Financial,Analysis,Fundamental,Quantitative,Database,Equities,Currencies,Economics,ETFs,Funds,Indices,Moneymarkets,Commodities,Futures,CFDs,Derivatives,Trading,Investing,Portfolio,Optimization,Performance
|
|
6
6
|
Author-Email: Bertin Balouki SIMYELI <bertin@bbs-trading.com>
|
|
@@ -51,14 +51,15 @@ Description-Content-Type: text/markdown
|
|
|
51
51
|
|
|
52
52
|
# Simplified Investment & Trading Toolkit with Python & C++
|
|
53
53
|
|
|
54
|
+
[](https://github.com/bbalouki/bbstrader/actions/workflows/build.yml)
|
|
54
55
|
[](https://bbstrader.readthedocs.io/en/latest/?badge=latest)
|
|
55
|
-
[](https://pypi.org/project/bbstrader/)
|
|
56
56
|
[](https://pypi.python.org/pypi/bbstrader)
|
|
57
|
-
[](https://pypi.org/project/bbstrader/)
|
|
58
|
-
[](https://github.com/bbalouki/bbstrader/actions/workflows/build.yml)
|
|
59
57
|

|
|
60
58
|

|
|
61
59
|

|
|
60
|
+
[](https://pypi.org/project/bbstrader/)
|
|
61
|
+
[](https://pypi.org/project/bbstrader/)
|
|
62
|
+

|
|
62
63
|
[](https://isocpp.org/std/the-standard)
|
|
63
64
|
[](https://cmake.org/)
|
|
64
65
|
[](https://pepy.tech/projects/bbstrader)
|
|
@@ -117,7 +118,7 @@ With thousands of downloads, `bbstrader` is trusted by traders worldwide. It's n
|
|
|
117
118
|
|
|
118
119
|
## **The `bbstrader` Edge: Uniting C++ Speed with Python Flexibility**
|
|
119
120
|
|
|
120
|
-
bbstrader's hybrid design is its secret weapon. At the heart is a bidirectional C++/Python bridge via `
|
|
121
|
+
bbstrader's hybrid design is its secret weapon. At the heart is a bidirectional C++/Python bridge via `client` module:
|
|
121
122
|
|
|
122
123
|
1. **C++ for Speed**: Core classes like `MetaTraderClient` handle high-performance tasks. Inject Python handlers for MT5 interactions, enabling native-speed signal generation and risk checks.
|
|
123
124
|
2. **Python for Smarts**: Orchestrate everything with modules like `trading` and `btengine`.
|
|
@@ -260,7 +261,7 @@ This pattern is ideal for strategies that benefit from Python's rich ecosystem f
|
|
|
260
261
|
```python
|
|
261
262
|
import MetaTrader5 as mt5
|
|
262
263
|
from bbstrader.api import Mt5Handlers
|
|
263
|
-
from bbstrader.api.
|
|
264
|
+
from bbstrader.api.client import MetaTraderClient
|
|
264
265
|
|
|
265
266
|
# 1. Inherit from the C++ MetaTraderClient in Python
|
|
266
267
|
class MyStrategyClient(MetaTraderClient):
|
|
@@ -350,7 +351,7 @@ git clone https://github.com/microsoft/vcpkg
|
|
|
350
351
|
| :----------------- | :-------------------------------------------------------------------------------------------------------------------- |
|
|
351
352
|
| **Run Backtest** | `python -m bbstrader --run backtest --strategy SMAStrategy --account MY_ACCOUNT --config backtest.json` |
|
|
352
353
|
| **Live Execution** | `python -m bbstrader --run execution --strategy KalmanFilter --account MY_ACCOUNT --config execution.json --parallel` |
|
|
353
|
-
| **Copy Trades** | `python -m bbstrader --run copier --source
|
|
354
|
+
| **Copy Trades** | `python -m bbstrader --run copier --source "S1" --destination "D1"` |
|
|
354
355
|
| **Get Help** | `python -m bbstrader --help` |
|
|
355
356
|
|
|
356
357
|
**Config Example** (`~/.bbstrader/execution/execution.json`):
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
# Simplified Investment & Trading Toolkit with Python & C++
|
|
2
2
|
|
|
3
|
+
[](https://github.com/bbalouki/bbstrader/actions/workflows/build.yml)
|
|
3
4
|
[](https://bbstrader.readthedocs.io/en/latest/?badge=latest)
|
|
4
|
-
[](https://pypi.org/project/bbstrader/)
|
|
5
5
|
[](https://pypi.python.org/pypi/bbstrader)
|
|
6
|
-
[](https://pypi.org/project/bbstrader/)
|
|
7
|
-
[](https://github.com/bbalouki/bbstrader/actions/workflows/build.yml)
|
|
8
6
|

|
|
9
7
|

|
|
10
8
|

|
|
9
|
+
[](https://pypi.org/project/bbstrader/)
|
|
10
|
+
[](https://pypi.org/project/bbstrader/)
|
|
11
|
+

|
|
11
12
|
[](https://isocpp.org/std/the-standard)
|
|
12
13
|
[](https://cmake.org/)
|
|
13
14
|
[](https://pepy.tech/projects/bbstrader)
|
|
@@ -66,7 +67,7 @@ With thousands of downloads, `bbstrader` is trusted by traders worldwide. It's n
|
|
|
66
67
|
|
|
67
68
|
## **The `bbstrader` Edge: Uniting C++ Speed with Python Flexibility**
|
|
68
69
|
|
|
69
|
-
bbstrader's hybrid design is its secret weapon. At the heart is a bidirectional C++/Python bridge via `
|
|
70
|
+
bbstrader's hybrid design is its secret weapon. At the heart is a bidirectional C++/Python bridge via `client` module:
|
|
70
71
|
|
|
71
72
|
1. **C++ for Speed**: Core classes like `MetaTraderClient` handle high-performance tasks. Inject Python handlers for MT5 interactions, enabling native-speed signal generation and risk checks.
|
|
72
73
|
2. **Python for Smarts**: Orchestrate everything with modules like `trading` and `btengine`.
|
|
@@ -209,7 +210,7 @@ This pattern is ideal for strategies that benefit from Python's rich ecosystem f
|
|
|
209
210
|
```python
|
|
210
211
|
import MetaTrader5 as mt5
|
|
211
212
|
from bbstrader.api import Mt5Handlers
|
|
212
|
-
from bbstrader.api.
|
|
213
|
+
from bbstrader.api.client import MetaTraderClient
|
|
213
214
|
|
|
214
215
|
# 1. Inherit from the C++ MetaTraderClient in Python
|
|
215
216
|
class MyStrategyClient(MetaTraderClient):
|
|
@@ -299,7 +300,7 @@ git clone https://github.com/microsoft/vcpkg
|
|
|
299
300
|
| :----------------- | :-------------------------------------------------------------------------------------------------------------------- |
|
|
300
301
|
| **Run Backtest** | `python -m bbstrader --run backtest --strategy SMAStrategy --account MY_ACCOUNT --config backtest.json` |
|
|
301
302
|
| **Live Execution** | `python -m bbstrader --run execution --strategy KalmanFilter --account MY_ACCOUNT --config execution.json --parallel` |
|
|
302
|
-
| **Copy Trades** | `python -m bbstrader --run copier --source
|
|
303
|
+
| **Copy Trades** | `python -m bbstrader --run copier --source "S1" --destination "D1"` |
|
|
303
304
|
| **Get Help** | `python -m bbstrader --help` |
|
|
304
305
|
|
|
305
306
|
**Config Example** (`~/.bbstrader/execution/execution.json`):
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.0.5
|
|
@@ -76,7 +76,7 @@ MT5 = ["MetaTrader5"]
|
|
|
76
76
|
[tool.scikit-build]
|
|
77
77
|
cmake.version = ">=3.20"
|
|
78
78
|
cmake.define = { "BUILD_PYTHON_BINDINGS" = "ON", "CMAKE_VS_GLOBALS" = "IgnoreWarnIntDirInTempDetected=true" }
|
|
79
|
-
wheel.packages = ["bbstrader"]
|
|
79
|
+
wheel.packages = ["src/bbstrader"]
|
|
80
80
|
|
|
81
81
|
[tool.scikit-build.metadata.version]
|
|
82
82
|
provider = "scikit_build_core.metadata.regex"
|
|
@@ -84,4 +84,4 @@ input = "VERSION.txt"
|
|
|
84
84
|
regex = '(?P<value>\d+\.\d+\.\d+)'
|
|
85
85
|
|
|
86
86
|
[tool.scikit-build.sdist]
|
|
87
|
-
include = ["bbstrader/assets/*"]
|
|
87
|
+
include = ["src/bbstrader/assets/*"]
|
|
@@ -4,7 +4,7 @@ include(GNUInstallDirs)
|
|
|
4
4
|
|
|
5
5
|
# 1. Core C++ Library
|
|
6
6
|
add_library(bbstrader
|
|
7
|
-
bbstrader.cpp
|
|
7
|
+
cpp/bbstrader.cpp
|
|
8
8
|
)
|
|
9
9
|
add_library(bbstrader::bbstrader ALIAS bbstrader)
|
|
10
10
|
configure_visibility(bbstrader)
|
|
@@ -49,29 +49,29 @@ if(BUILD_PYTHON_BINDINGS)
|
|
|
49
49
|
endif()
|
|
50
50
|
|
|
51
51
|
target_link_libraries(bbstrader PRIVATE pybind11::headers)
|
|
52
|
-
pybind11_add_module(
|
|
52
|
+
pybind11_add_module(client MODULE cpp/metatrader.cpp)
|
|
53
53
|
target_include_directories(
|
|
54
|
-
|
|
54
|
+
client PRIVATE
|
|
55
55
|
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
|
|
56
56
|
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
|
57
57
|
)
|
|
58
|
-
target_link_libraries(
|
|
59
|
-
target_link_libraries(
|
|
58
|
+
target_link_libraries(client PRIVATE bbstrader)
|
|
59
|
+
target_link_libraries(client PRIVATE pybind11::module)
|
|
60
60
|
|
|
61
|
-
configure_visibility(
|
|
61
|
+
configure_visibility(client)
|
|
62
62
|
|
|
63
63
|
if(MSVC)
|
|
64
|
-
target_compile_options(
|
|
64
|
+
target_compile_options(client PRIVATE /bigobj)
|
|
65
65
|
endif()
|
|
66
66
|
if (NOT ANDROID)
|
|
67
67
|
target_link_libraries(
|
|
68
|
-
|
|
68
|
+
client
|
|
69
69
|
PRIVATE warnings::strict
|
|
70
70
|
)
|
|
71
71
|
endif()
|
|
72
72
|
|
|
73
73
|
# INSTALLATION INSTRUCTIONS FOR PYTHON
|
|
74
|
-
install(TARGETS
|
|
74
|
+
install(TARGETS client DESTINATION bbstrader/api)
|
|
75
75
|
|
|
76
76
|
endif()
|
|
77
77
|
|
|
@@ -36,7 +36,7 @@ from operator import attrgetter
|
|
|
36
36
|
import pandas as pd
|
|
37
37
|
|
|
38
38
|
from bbstrader.api.handlers import Mt5Handlers
|
|
39
|
-
from bbstrader.api.
|
|
39
|
+
from bbstrader.api.client import * # type: ignore # noqa: F403
|
|
40
40
|
|
|
41
41
|
# ruff: noqa: F405
|
|
42
42
|
classes_to_patch = [
|