hummingbot / dashboard

Application that helps you create, backtest, deploy, and manage Hummingbot instances
Apache License 2.0
175 stars 115 forks source link

Backtest manager - The Strategy name does not accept names separated by "-" #79

Closed rapcmia closed 2 months ago

rapcmia commented 12 months ago

Describe the bug

When creating a strategy name for backtest manager using a template, it does not accept names separated by -. For example {test-01, market-making} and will return an error of SyntaxError: invalid decimal literal

image

SyntaxError: File "/Users/rapcomia/github/dashboard/dashboard/quants_lab/controllers/customstrategy-1.py", line 14 class CustomStrategy-1Config(DirectionalTradingControllerConfigBase): ^ SyntaxError: invalid decimal literal
Traceback:
File "/Users/rapcomia/anaconda3/envs/dashboard/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 541, in _run_script
    exec(code, module.__dict__)
File "/Users/rapcomia/github/dashboard/dashboard/pages/backtest_manager/create.py", line 48, in <module>
    ds_board.file_explorer()
File "/Users/rapcomia/github/dashboard/dashboard/ui_components/file_explorer_base.py", line 62, in __call__
    self.add_tree_view()
File "/Users/rapcomia/github/dashboard/dashboard/ui_components/controllers_file_explorer.py", line 13, in add_tree_view
    available_controllers = load_controllers(constants.CONTROLLERS_PATH)
File "/Users/rapcomia/github/dashboard/dashboard/utils/os_utils.py", line 92, in load_controllers
    spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 879, in exec_module
File "<frozen importlib._bootstrap_external>", line 1017, in get_code
File "<frozen importlib._bootstrap_external>", line 947, in source_to_code
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed

_Note: To fix, simple go to the dashboard folder then quants_lab/controller and look for the file. Delete it_

Steps to reproduce bug

  1. Run backtest manager
  2. Create a strategy name separated with -