bbstrader 0.2.96__py3-none-any.whl → 0.2.98__py3-none-any.whl
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.
Potentially problematic release.
This version of bbstrader might be problematic. Click here for more details.
- bbstrader/__main__.py +2 -1
- bbstrader/btengine/data.py +6 -6
- bbstrader/btengine/execution.py +1 -1
- bbstrader/btengine/strategy.py +90 -101
- bbstrader/core/utils.py +0 -58
- bbstrader/metatrader/account.py +30 -6
- bbstrader/metatrader/copier.py +7 -11
- bbstrader/metatrader/trade.py +186 -68
- bbstrader/metatrader/utils.py +16 -0
- bbstrader/models/risk.py +2 -2
- bbstrader/trading/execution.py +691 -550
- bbstrader/trading/scripts.py +10 -11
- bbstrader/trading/strategies.py +6 -0
- {bbstrader-0.2.96.dist-info → bbstrader-0.2.98.dist-info}/METADATA +12 -15
- {bbstrader-0.2.96.dist-info → bbstrader-0.2.98.dist-info}/RECORD +19 -19
- {bbstrader-0.2.96.dist-info → bbstrader-0.2.98.dist-info}/WHEEL +0 -0
- {bbstrader-0.2.96.dist-info → bbstrader-0.2.98.dist-info}/entry_points.txt +0 -0
- {bbstrader-0.2.96.dist-info → bbstrader-0.2.98.dist-info}/licenses/LICENSE +0 -0
- {bbstrader-0.2.96.dist-info → bbstrader-0.2.98.dist-info}/top_level.txt +0 -0
bbstrader/trading/scripts.py
CHANGED
|
@@ -7,7 +7,7 @@ import sys
|
|
|
7
7
|
from bbstrader.btengine import MT5Strategy, Strategy
|
|
8
8
|
from bbstrader.core.utils import load_class, load_module
|
|
9
9
|
from bbstrader.metatrader.trade import create_trade_instance
|
|
10
|
-
from bbstrader.trading.execution import
|
|
10
|
+
from bbstrader.trading.execution import RunMt5Engine
|
|
11
11
|
|
|
12
12
|
EXECUTION_PATH = os.path.expanduser("~/.bbstrader/execution/execution.py")
|
|
13
13
|
CONFIG_PATH = os.path.expanduser("~/.bbstrader/execution/execution.json")
|
|
@@ -52,10 +52,10 @@ def worker_function(account, args):
|
|
|
52
52
|
"account": account,
|
|
53
53
|
**config,
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
RunMt5Engine(account, **kwargs)
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
def
|
|
58
|
+
def RunMt5Terminal(args):
|
|
59
59
|
if args.parallel:
|
|
60
60
|
if len(args.account) == 0:
|
|
61
61
|
raise ValueError(
|
|
@@ -82,12 +82,11 @@ def mt5_terminal(args):
|
|
|
82
82
|
p.join()
|
|
83
83
|
print("Execution terminated")
|
|
84
84
|
else:
|
|
85
|
-
worker_function(
|
|
85
|
+
worker_function(args.account[0], args)
|
|
86
86
|
|
|
87
87
|
|
|
88
|
-
def
|
|
89
|
-
raise NotImplementedError("
|
|
90
|
-
|
|
88
|
+
def RunTWSTerminal(args):
|
|
89
|
+
raise NotImplementedError("RunTWSTerminal is not implemented yet")
|
|
91
90
|
|
|
92
91
|
def execute_strategy(unknown):
|
|
93
92
|
HELP_MSG = """
|
|
@@ -128,11 +127,11 @@ def execute_strategy(unknown):
|
|
|
128
127
|
}
|
|
129
128
|
}
|
|
130
129
|
See bbstrader.metatrader.trade.create_trade_instance for more details on the trades_kwargs.
|
|
131
|
-
See bbstrader.trading.execution.
|
|
130
|
+
See bbstrader.trading.execution.Mt5ExecutionEngine for more details on the other parameters.
|
|
132
131
|
|
|
133
132
|
All other paramaters must be python built-in types.
|
|
134
133
|
If you have custom type you must set them in your strategy class
|
|
135
|
-
or run the
|
|
134
|
+
or run the Mt5ExecutionEngine directly, don't run on CLI.
|
|
136
135
|
"""
|
|
137
136
|
if "-h" in unknown or "--help" in unknown:
|
|
138
137
|
print(HELP_MSG)
|
|
@@ -150,6 +149,6 @@ def execute_strategy(unknown):
|
|
|
150
149
|
args = parser.parse_args(unknown)
|
|
151
150
|
|
|
152
151
|
if args.terminal == "MT5":
|
|
153
|
-
|
|
152
|
+
RunMt5Terminal(args)
|
|
154
153
|
elif args.terminal == "TWS":
|
|
155
|
-
|
|
154
|
+
RunTWSTerminal(args)
|
bbstrader/trading/strategies.py
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Strategies module for trading strategies backtesting and execution.
|
|
3
|
+
|
|
4
|
+
DISCLAIMER:
|
|
5
|
+
This module is for educational purposes only and should not be
|
|
6
|
+
considered as financial advice. Always consult with a qualified financial advisor before making any investment decisions.
|
|
7
|
+
The authors and contributors of this module are not responsible for any financial losses or damages incurred as a result of using
|
|
8
|
+
this module or the information contained herein.
|
|
3
9
|
"""
|
|
4
10
|
|
|
5
11
|
from datetime import datetime
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bbstrader
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.98
|
|
4
4
|
Summary: Simplified Investment & Trading Toolkit
|
|
5
5
|
Home-page: https://github.com/bbalouki/bbstrader
|
|
6
6
|
Download-URL: https://pypi.org/project/bbstrader/
|
|
@@ -24,21 +24,24 @@ Classifier: Operating System :: MacOS
|
|
|
24
24
|
Classifier: License :: OSI Approved :: MIT License
|
|
25
25
|
Description-Content-Type: text/markdown
|
|
26
26
|
License-File: LICENSE
|
|
27
|
-
Requires-Dist:
|
|
27
|
+
Requires-Dist: numpy<2.0.0,>=1.26.0
|
|
28
|
+
Requires-Dist: scikit-learn
|
|
29
|
+
Requires-Dist: statsmodels
|
|
30
|
+
Requires-Dist: seaborn
|
|
31
|
+
Requires-Dist: lightgbm
|
|
32
|
+
Requires-Dist: dash
|
|
33
|
+
Requires-Dist: nltk
|
|
34
|
+
Requires-Dist: spacy
|
|
35
|
+
Requires-Dist: pmdarima
|
|
36
|
+
Requires-Dist: pyportfolioopt
|
|
37
|
+
Requires-Dist: alphalens-reloaded
|
|
28
38
|
Requires-Dist: pandas_ta
|
|
29
|
-
Requires-Dist: numpy<2.0.0
|
|
30
39
|
Requires-Dist: yfinance
|
|
31
|
-
Requires-Dist: scipy
|
|
32
40
|
Requires-Dist: hmmlearn
|
|
33
|
-
Requires-Dist: pmdarima
|
|
34
41
|
Requires-Dist: arch
|
|
35
42
|
Requires-Dist: hurst
|
|
36
|
-
Requires-Dist: seaborn
|
|
37
|
-
Requires-Dist: statsmodels
|
|
38
|
-
Requires-Dist: matplotlib
|
|
39
43
|
Requires-Dist: filterpy
|
|
40
44
|
Requires-Dist: pykalman
|
|
41
|
-
Requires-Dist: pytest
|
|
42
45
|
Requires-Dist: CurrencyConverter
|
|
43
46
|
Requires-Dist: tabulate
|
|
44
47
|
Requires-Dist: python-dotenv
|
|
@@ -46,23 +49,17 @@ Requires-Dist: ipython
|
|
|
46
49
|
Requires-Dist: QuantStats
|
|
47
50
|
Requires-Dist: exchange-calendars
|
|
48
51
|
Requires-Dist: tqdm
|
|
49
|
-
Requires-Dist: scikit-learn
|
|
50
52
|
Requires-Dist: notify-py
|
|
51
53
|
Requires-Dist: python-telegram-bot
|
|
52
|
-
Requires-Dist: pyportfolioopt
|
|
53
54
|
Requires-Dist: eodhd
|
|
54
55
|
Requires-Dist: financetoolkit
|
|
55
56
|
Requires-Dist: PyYAML
|
|
56
57
|
Requires-Dist: tables
|
|
57
|
-
Requires-Dist: lightgbm
|
|
58
|
-
Requires-Dist: alphalens-reloaded
|
|
59
58
|
Requires-Dist: pyfiglet
|
|
60
59
|
Requires-Dist: colorama
|
|
61
60
|
Requires-Dist: praw
|
|
62
61
|
Requires-Dist: tweepy
|
|
63
62
|
Requires-Dist: beautifulsoup4
|
|
64
|
-
Requires-Dist: dash
|
|
65
|
-
Requires-Dist: nltk
|
|
66
63
|
Requires-Dist: textblob
|
|
67
64
|
Requires-Dist: vaderSentiment
|
|
68
65
|
Provides-Extra: mt5
|
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
bbstrader/__ini__.py,sha256=v6zyJHj5FMRL-_P7AwnTGbCF-riMqhqlTvDgfulj7go,621
|
|
2
|
-
bbstrader/__main__.py,sha256=
|
|
2
|
+
bbstrader/__main__.py,sha256=sDdjoiaHSPrVqdjU_zOLajX3rD_3Ha6dHwIivYc_vp4,1525
|
|
3
3
|
bbstrader/compat.py,sha256=djbHMvTvy0HYm1zyZ6Ttp_LMwP2PqTSVw1r7pqbz7So,487
|
|
4
4
|
bbstrader/config.py,sha256=c2nCUw-bYWf5kkyFls5Nqld8HdMczexSilTni7rYUBw,3973
|
|
5
5
|
bbstrader/tseries.py,sha256=H4D_A966HdN8YjBfuCcF8QBQdhjOrTcidR98wP2KN_I,68339
|
|
6
6
|
bbstrader/btengine/__init__.py,sha256=y1btjaEfhWsH8vuE7mBRpP9Tu-Azt9REhuVYsPCAfBU,2955
|
|
7
7
|
bbstrader/btengine/backtest.py,sha256=ZzGhoN-_g0cF-OCyk173imze2OXEhykHTUiJ9MowDO8,14582
|
|
8
|
-
bbstrader/btengine/data.py,sha256=
|
|
8
|
+
bbstrader/btengine/data.py,sha256=Tuc6M8itbGpPjsfRpZBB8v0FJpPt7-hUkP6I5meP0Sg,26927
|
|
9
9
|
bbstrader/btengine/event.py,sha256=38mhZH9d53C4x7bZER2B0O6M18txzS4u7zveKyxeP5Y,8603
|
|
10
|
-
bbstrader/btengine/execution.py,sha256=
|
|
10
|
+
bbstrader/btengine/execution.py,sha256=mXY0tyFv6G1XF48R5Kx2-pDnwu1mUyOc0ZeeysQG62A,10587
|
|
11
11
|
bbstrader/btengine/performance.py,sha256=1ecWrTzHBQbk4ORvbTEKxwCzlL1brcXOEUwgbnjAwx4,12470
|
|
12
12
|
bbstrader/btengine/portfolio.py,sha256=mh2_zNJDmKzb0lo55PXhbXYxXMmXRA4YLkgzwxRMuZE,16110
|
|
13
13
|
bbstrader/btengine/scripts.py,sha256=8o66dq4Ex4DsH4s8xvJqUOFjLzZJSnbBvvNBzohtzoE,4837
|
|
14
|
-
bbstrader/btengine/strategy.py,sha256=
|
|
14
|
+
bbstrader/btengine/strategy.py,sha256=147_i9mnYo1RUMpF6QqxXRhE6cuHh6eY9WbnZ5nqSso,31373
|
|
15
15
|
bbstrader/core/__init__.py,sha256=GIFzFSStPfE0XM2j7mDeZZQeMTh_AwPsDOQXwMVJLgw,97
|
|
16
16
|
bbstrader/core/data.py,sha256=VPuynoT0uFYduh7la8gZSnEv_Gq8Xu2vJZJ7TfQMll8,18797
|
|
17
|
-
bbstrader/core/utils.py,sha256=
|
|
17
|
+
bbstrader/core/utils.py,sha256=WjuabzBjhY65ku2KL-f7CMalE2x-wrX-6mCA_qhhFPE,2728
|
|
18
18
|
bbstrader/ibkr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
19
|
bbstrader/ibkr/utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
20
|
bbstrader/metatrader/__init__.py,sha256=A5Ye9tpc2sp9Xk5qjKw-EfYsoRcZtAt8nqvC3tCtZs8,333
|
|
21
|
-
bbstrader/metatrader/account.py,sha256=
|
|
22
|
-
bbstrader/metatrader/copier.py,sha256=
|
|
21
|
+
bbstrader/metatrader/account.py,sha256=Pwg8rVmxLLkUvcrUajfdA9Lx7u9kauJ5xXWdkPOpvTE,57374
|
|
22
|
+
bbstrader/metatrader/copier.py,sha256=4Rlq3V7jmMNPRb43f9AiZxdQkYOpze8lYdg3DoSxSfo,31532
|
|
23
23
|
bbstrader/metatrader/rates.py,sha256=0bKyjGnafZ19DwC0-IxXUBJzOdAo-cNmhabwhKLxcos,20585
|
|
24
24
|
bbstrader/metatrader/risk.py,sha256=pwG4q1_uPGgPlokDGVNtd04O6p28yIbgT-evvHuo-Qc,27029
|
|
25
25
|
bbstrader/metatrader/scripts.py,sha256=Yjp7Un-wDTInptHS_rPFpXNKWbVM871VEkaHxsO2MPQ,2115
|
|
26
|
-
bbstrader/metatrader/trade.py,sha256=
|
|
27
|
-
bbstrader/metatrader/utils.py,sha256=
|
|
26
|
+
bbstrader/metatrader/trade.py,sha256=R3PR1bJhBw9osCuAuoERucAJ0kUWGlXyG27wy3yXw9w,80137
|
|
27
|
+
bbstrader/metatrader/utils.py,sha256=szORxKJW9OG-H6nof_ovOhToSx_n8EtVwe0mkLt3eFg,17424
|
|
28
28
|
bbstrader/models/__init__.py,sha256=s2mJrtKePXQaw_PvcrtPCD2mPCdVXP4Myzg0MlLVipo,547
|
|
29
29
|
bbstrader/models/factors.py,sha256=5kSAOS1MHvTZ-Ti03TtjOxl_EvC-V_9e389xeR_82ak,13020
|
|
30
30
|
bbstrader/models/ml.py,sha256=tCr7YyODl0CDoOUpYqJ1q12ls86Sc-_Fu3b2Y0Z7TJ8,47551
|
|
31
31
|
bbstrader/models/nlp.py,sha256=P7SYaTIqEBldjwYfS6IrO66Y6-ioDXUrCSf3bZxQrDE,28073
|
|
32
32
|
bbstrader/models/optimization.py,sha256=vnks6uxFZdqXgxaZJNxq8z0IH45KZ8yaXo38JhIVKGc,6399
|
|
33
33
|
bbstrader/models/portfolio.py,sha256=r-47Zrn2r7iKCHm5YVtwkbBJXAZGM3QYy-rXCWY9-Bg,8079
|
|
34
|
-
bbstrader/models/risk.py,sha256=
|
|
34
|
+
bbstrader/models/risk.py,sha256=JQOXPshMOru6Eb0AMU6oKCNzg6mlGfL6_tN90lWcVBE,14878
|
|
35
35
|
bbstrader/trading/__init__.py,sha256=ycLyuuxN5SujqtzR9X0Q74UQfK93q2va-GGAXdr-KS8,457
|
|
36
|
-
bbstrader/trading/execution.py,sha256=
|
|
37
|
-
bbstrader/trading/scripts.py,sha256=
|
|
38
|
-
bbstrader/trading/strategies.py,sha256=
|
|
36
|
+
bbstrader/trading/execution.py,sha256=IQCPd-MAColYw3H_2WqbBzLIOAhVqNWvZ-bZIaml-ro,38160
|
|
37
|
+
bbstrader/trading/scripts.py,sha256=Tf5q33WqqygjpIv43_8nA82VZ3GM0qgb4Ggo3fHJ_wg,5744
|
|
38
|
+
bbstrader/trading/strategies.py,sha256=D_M91UwRiFwZKvKFKmz427TPd-dNyWWbhehaP8RI17c,36539
|
|
39
39
|
bbstrader/trading/utils.py,sha256=57dKF9dcRu04oU2VRqydRrzW39dCW2wlDWhVt-sZdRw,1857
|
|
40
|
-
bbstrader-0.2.
|
|
41
|
-
bbstrader-0.2.
|
|
42
|
-
bbstrader-0.2.
|
|
43
|
-
bbstrader-0.2.
|
|
44
|
-
bbstrader-0.2.
|
|
45
|
-
bbstrader-0.2.
|
|
40
|
+
bbstrader-0.2.98.dist-info/licenses/LICENSE,sha256=ZwC_RqqGmOPBUiMDKqLyJZ5HBeHq53LpL7TMRzrJY8c,1094
|
|
41
|
+
bbstrader-0.2.98.dist-info/METADATA,sha256=M9AZGC1rK4ygm9BEIZZJMYyfldWxb2Pu0zY9Q6ep7Ew,11508
|
|
42
|
+
bbstrader-0.2.98.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
43
|
+
bbstrader-0.2.98.dist-info/entry_points.txt,sha256=0yDCbhbgHswOzJnY5wRSM_FjjyMHGvY7lJpSSVh0xtI,54
|
|
44
|
+
bbstrader-0.2.98.dist-info/top_level.txt,sha256=Wwj322jZmxGZ6gD_TdaPiPLjED5ReObm5omerwlmZIg,10
|
|
45
|
+
bbstrader-0.2.98.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|