bbstrader 0.2.92__py3-none-any.whl → 0.2.94__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.

Files changed (36) hide show
  1. bbstrader/__ini__.py +20 -20
  2. bbstrader/__main__.py +50 -50
  3. bbstrader/btengine/__init__.py +54 -54
  4. bbstrader/btengine/data.py +11 -9
  5. bbstrader/btengine/scripts.py +157 -157
  6. bbstrader/compat.py +19 -19
  7. bbstrader/config.py +137 -137
  8. bbstrader/core/data.py +22 -22
  9. bbstrader/core/utils.py +146 -146
  10. bbstrader/metatrader/__init__.py +6 -6
  11. bbstrader/metatrader/account.py +1516 -1516
  12. bbstrader/metatrader/copier.py +750 -735
  13. bbstrader/metatrader/rates.py +584 -584
  14. bbstrader/metatrader/risk.py +749 -748
  15. bbstrader/metatrader/scripts.py +81 -81
  16. bbstrader/metatrader/trade.py +1836 -1826
  17. bbstrader/metatrader/utils.py +645 -645
  18. bbstrader/models/__init__.py +10 -10
  19. bbstrader/models/factors.py +312 -312
  20. bbstrader/models/ml.py +1272 -1265
  21. bbstrader/models/optimization.py +182 -182
  22. bbstrader/models/portfolio.py +223 -223
  23. bbstrader/models/risk.py +398 -398
  24. bbstrader/trading/__init__.py +11 -11
  25. bbstrader/trading/execution.py +846 -842
  26. bbstrader/trading/script.py +155 -155
  27. bbstrader/trading/scripts.py +69 -69
  28. bbstrader/trading/strategies.py +860 -860
  29. bbstrader/tseries.py +1842 -1842
  30. {bbstrader-0.2.92.dist-info → bbstrader-0.2.94.dist-info}/LICENSE +21 -21
  31. {bbstrader-0.2.92.dist-info → bbstrader-0.2.94.dist-info}/METADATA +188 -187
  32. bbstrader-0.2.94.dist-info/RECORD +44 -0
  33. {bbstrader-0.2.92.dist-info → bbstrader-0.2.94.dist-info}/WHEEL +1 -1
  34. bbstrader-0.2.92.dist-info/RECORD +0 -44
  35. {bbstrader-0.2.92.dist-info → bbstrader-0.2.94.dist-info}/entry_points.txt +0 -0
  36. {bbstrader-0.2.92.dist-info → bbstrader-0.2.94.dist-info}/top_level.txt +0 -0
@@ -1,81 +1,81 @@
1
- import argparse
2
- import sys
3
-
4
- from bbstrader.metatrader.copier import RunCopier, config_copier
5
-
6
-
7
- def copier_args(parser: argparse.ArgumentParser):
8
- parser.add_argument(
9
- "-S", "--source", type=str, nargs="?", default=None, help="Source section name"
10
- )
11
- parser.add_argument(
12
- "-D",
13
- "--destinations",
14
- type=str,
15
- nargs="*",
16
- default=None,
17
- help="Destination section names",
18
- )
19
- parser.add_argument(
20
- "-I", "--interval", type=float, default=0.1, help="Update interval in seconds"
21
- )
22
- parser.add_argument(
23
- "-C",
24
- "--config",
25
- nargs="?",
26
- default=None,
27
- type=str,
28
- help="Config file name or path",
29
- )
30
- parser.add_argument(
31
- "-T",
32
- "--start",
33
- type=str,
34
- nargs="?",
35
- default=None,
36
- help="Start time in HH:MM format",
37
- )
38
- parser.add_argument(
39
- "-E",
40
- "--end",
41
- type=str,
42
- nargs="?",
43
- default=None,
44
- help="End time in HH:MM format",
45
- )
46
- return parser
47
-
48
-
49
- def copy_trades(unknown):
50
- HELP_MSG = """
51
- Usage:
52
- python -m bbstrader --run copier [options]
53
-
54
- Options:
55
- -s, --source: Source Account section name
56
- -d, --destinations: Destination Account section names (multiple allowed)
57
- -i, --interval: Update interval in seconds
58
- -c, --config: .ini file or path (default: ~/.bbstrader/copier/copier.ini)
59
- -t, --start: Start time in HH:MM format
60
- -e, --end: End time in HH:MM format
61
- """
62
- if "-h" in unknown or "--help" in unknown:
63
- print(HELP_MSG)
64
- sys.exit(0)
65
-
66
- copy_parser = argparse.ArgumentParser("Trades Copier", add_help=False)
67
- copy_parser = copier_args(copy_parser)
68
- copy_args = copy_parser.parse_args(unknown)
69
-
70
- source, destinations = config_copier(
71
- source_section=copy_args.source,
72
- dest_sections=copy_args.destinations,
73
- inifile=copy_args.config,
74
- )
75
- RunCopier(
76
- source,
77
- destinations,
78
- copy_args.interval,
79
- copy_args.start,
80
- copy_args.end,
81
- )
1
+ import argparse
2
+ import sys
3
+
4
+ from bbstrader.metatrader.copier import RunCopier, config_copier
5
+
6
+
7
+ def copier_args(parser: argparse.ArgumentParser):
8
+ parser.add_argument(
9
+ "-s", "--source", type=str, nargs="?", default=None, help="Source section name"
10
+ )
11
+ parser.add_argument(
12
+ "-d",
13
+ "--destinations",
14
+ type=str,
15
+ nargs="*",
16
+ default=None,
17
+ help="Destination section names",
18
+ )
19
+ parser.add_argument(
20
+ "-i", "--interval", type=float, default=0.1, help="Update interval in seconds"
21
+ )
22
+ parser.add_argument(
23
+ "-c",
24
+ "--config",
25
+ nargs="?",
26
+ default=None,
27
+ type=str,
28
+ help="Config file name or path",
29
+ )
30
+ parser.add_argument(
31
+ "-t",
32
+ "--start",
33
+ type=str,
34
+ nargs="?",
35
+ default=None,
36
+ help="Start time in HH:MM format",
37
+ )
38
+ parser.add_argument(
39
+ "-e",
40
+ "--end",
41
+ type=str,
42
+ nargs="?",
43
+ default=None,
44
+ help="End time in HH:MM format",
45
+ )
46
+ return parser
47
+
48
+
49
+ def copy_trades(unknown):
50
+ HELP_MSG = """
51
+ Usage:
52
+ python -m bbstrader --run copier [options]
53
+
54
+ Options:
55
+ -s, --source: Source Account section name
56
+ -d, --destinations: Destination Account section names (multiple allowed)
57
+ -i, --interval: Update interval in seconds
58
+ -c, --config: .ini file or path (default: ~/.bbstrader/copier/copier.ini)
59
+ -t, --start: Start time in HH:MM format
60
+ -e, --end: End time in HH:MM format
61
+ """
62
+ if "-h" in unknown or "--help" in unknown:
63
+ print(HELP_MSG)
64
+ sys.exit(0)
65
+
66
+ copy_parser = argparse.ArgumentParser("Trades Copier", add_help=False)
67
+ copy_parser = copier_args(copy_parser)
68
+ copy_args = copy_parser.parse_args(unknown)
69
+
70
+ source, destinations = config_copier(
71
+ source_section=copy_args.source,
72
+ dest_sections=copy_args.destinations,
73
+ inifile=copy_args.config,
74
+ )
75
+ RunCopier(
76
+ source,
77
+ destinations,
78
+ copy_args.interval,
79
+ copy_args.start,
80
+ copy_args.end,
81
+ )