bbstrader 0.3.2__py3-none-any.whl → 0.3.4__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 +15 -7
- bbstrader/apps/__init__.py +0 -0
- bbstrader/apps/_copier.py +664 -0
- bbstrader/btengine/data.py +3 -3
- bbstrader/btengine/strategy.py +165 -90
- bbstrader/core/data.py +3 -1
- bbstrader/core/scripts.py +62 -19
- bbstrader/core/utils.py +5 -3
- bbstrader/metatrader/account.py +196 -42
- bbstrader/metatrader/analysis.py +7 -5
- bbstrader/metatrader/copier.py +325 -171
- bbstrader/metatrader/rates.py +2 -2
- bbstrader/metatrader/scripts.py +15 -2
- bbstrader/metatrader/trade.py +2 -2
- bbstrader/metatrader/utils.py +65 -5
- bbstrader/models/ml.py +8 -5
- bbstrader/models/nlp.py +16 -11
- bbstrader/trading/execution.py +100 -48
- bbstrader/tseries.py +0 -2
- {bbstrader-0.3.2.dist-info → bbstrader-0.3.4.dist-info}/METADATA +5 -5
- {bbstrader-0.3.2.dist-info → bbstrader-0.3.4.dist-info}/RECORD +25 -23
- {bbstrader-0.3.2.dist-info → bbstrader-0.3.4.dist-info}/WHEEL +0 -0
- {bbstrader-0.3.2.dist-info → bbstrader-0.3.4.dist-info}/entry_points.txt +0 -0
- {bbstrader-0.3.2.dist-info → bbstrader-0.3.4.dist-info}/licenses/LICENSE +0 -0
- {bbstrader-0.3.2.dist-info → bbstrader-0.3.4.dist-info}/top_level.txt +0 -0
bbstrader/__main__.py
CHANGED
|
@@ -12,7 +12,7 @@ from bbstrader.metatrader.scripts import copy_trades
|
|
|
12
12
|
from bbstrader.trading.scripts import execute_strategy
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
class
|
|
15
|
+
class _Module(Enum):
|
|
16
16
|
COPIER = "copier"
|
|
17
17
|
BACKTEST = "backtest"
|
|
18
18
|
EXECUTION = "execution"
|
|
@@ -52,23 +52,31 @@ def main():
|
|
|
52
52
|
sys.exit(0)
|
|
53
53
|
try:
|
|
54
54
|
match args.run:
|
|
55
|
-
case
|
|
55
|
+
case _Module.COPIER.value:
|
|
56
56
|
copy_trades(unknown)
|
|
57
|
-
case
|
|
57
|
+
case _Module.BACKTEST.value:
|
|
58
58
|
backtest(unknown)
|
|
59
|
-
case
|
|
59
|
+
case _Module.EXECUTION.value:
|
|
60
60
|
execute_strategy(unknown)
|
|
61
|
-
case
|
|
61
|
+
case _Module.NEWS_FEED.value:
|
|
62
62
|
send_news_feed(unknown)
|
|
63
63
|
case _:
|
|
64
64
|
print(Fore.RED + f"Unknown module: {args.run}")
|
|
65
65
|
sys.exit(1)
|
|
66
66
|
except KeyboardInterrupt:
|
|
67
67
|
sys.exit(0)
|
|
68
|
-
except Exception:
|
|
68
|
+
except Exception as e:
|
|
69
|
+
print(Fore.RED + f"Error: {e}")
|
|
69
70
|
sys.exit(1)
|
|
70
71
|
|
|
71
72
|
|
|
72
73
|
if __name__ == "__main__":
|
|
73
74
|
multiprocessing.freeze_support()
|
|
74
|
-
|
|
75
|
+
try:
|
|
76
|
+
main()
|
|
77
|
+
except KeyboardInterrupt:
|
|
78
|
+
print(Fore.RED + "\nExecution interrupted by user")
|
|
79
|
+
sys.exit(0)
|
|
80
|
+
except Exception as e:
|
|
81
|
+
print(Fore.RED + f"Error: {e}")
|
|
82
|
+
sys.exit(1)
|
|
File without changes
|