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 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 Module(Enum):
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 Module.COPIER.value:
55
+ case _Module.COPIER.value:
56
56
  copy_trades(unknown)
57
- case Module.BACKTEST.value:
57
+ case _Module.BACKTEST.value:
58
58
  backtest(unknown)
59
- case Module.EXECUTION.value:
59
+ case _Module.EXECUTION.value:
60
60
  execute_strategy(unknown)
61
- case Module.NEWS_FEED.value:
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
- main()
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