Principle:HKUDS AI Trader Agent Configuration
| Knowledge Sources | |
|---|---|
| Domains | Configuration, Software_Architecture |
| Last Updated | 2026-02-09 14:00 GMT |
Overview
A configuration management pattern that externalizes trading agent parameters into JSON files for flexible experiment setup.
Description
Agent Configuration externalizes all runtime parameters of the trading agent into structured JSON configuration files. This includes model selection (which LLMs to use), market settings (stock symbols, date ranges), agent behavior (max reasoning steps, initial cash), and infrastructure (log paths, API endpoints). By separating configuration from code, the system supports rapid experimentation with different models and parameters without code changes.
The configuration pattern is critical for the multi-agent comparison workflow, where multiple LLM models are configured in the same file with individual enable/disable flags.
Usage
Use this principle when launching trading agents to decouple runtime parameters from source code. The configuration is loaded once at startup and consumed by the agent initialization, trading loop, and metrics calculation steps.
Theoretical Basis
# Pseudocode for configuration management
config = load_json("configs/default_config.json")
# Override with environment variables if present
if env.INIT_DATE: config["date_range"]["init_date"] = env.INIT_DATE
if env.END_DATE: config["date_range"]["end_date"] = env.END_DATE
# Config structure:
# {
# "agent_type": "BaseAgent",
# "market": "us",
# "models": [{name, basemodel, signature, enabled, ...}],
# "date_range": {init_date, end_date},
# "agent_config": {max_steps, initial_cash},
# "log_config": {log_path}
# }
Key properties:
- Declarative: All parameters defined in JSON without code changes
- Multi-model: Multiple LLM configurations in a single file with enable flags
- Environment override: Date ranges and paths can be overridden via env vars
- Market-specific: Separate config files for US, A-share, and crypto markets