Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow limiting to one strategy #67

Merged
merged 3 commits into from
Aug 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix arg type and propagation
  • Loading branch information
r0fls committed Aug 3, 2024
commit 912908b23d409c125a0040d8f7a092964b7ffcc4
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ async def initialize_brokers_and_strategies(config, strategy_name=None):
raise
# Initialize the brokers and strategies
try:
brokers, strategies = await initialize_system_components(config)
brokers, strategies = await initialize_system_components(config, strategy_name)
except Exception as e:
logger.error('Failed to initialize brokers', extra={'error': str(e)})
return

# Initialize the strategies
try:
strategies = await initialize_strategies(brokers, config)
strategies = await initialize_strategies(brokers, config, strategy_name)
logger.info('Strategies initialized successfully')
except Exception as e:
logger.error('Failed to initialize strategies', extra={'error': str(e)})
Expand Down Expand Up @@ -187,7 +187,7 @@ async def main():
parser.add_argument('--mode', choices=['trade', 'api', 'sync'], required=True, help='Mode to run the system in: "trade", "api", or "sync"')
parser.add_argument('--config', type=str, help='Path to the YAML configuration file.')
parser.add_argument('--local_testing', action='store_true', help='Run API server with local testing configuration.')
parser.add_argument('--strategy', action='store_true', help='Run a single strategy.')
parser.add_argument('--strategy', type=str, help='Run a single strategy.')
args = parser.parse_args()

if args.mode == 'trade':
Expand Down
Loading