QTrade/configs/strategies/debug_000001.yaml
cuizhan 37a5df8bf6 重构配置系统:改为Config/Logger单例模式,拆分环境配置文件
主要改动:
1. Config类改为单例模式,支持根据global.yaml的current_mode自动加载环境配置
2. Logger类改为单例模式,通过类方法直接访问
3. 拆分配置文件:global.yaml仅指定模式,backtest.yaml/simulation.yaml/production.yaml存储各环境配置
4. 移除所有config参数传递,使用Config.get()直接访问
5. 移除所有logger实例传递,使用Logger.info()等类方法直接访问
6. 修复初始化顺序:Config.initialize() -> Logger.initialize() -> 其他组件
7. 修复Logger参数默认值,确保所有方法可正常调用
8. 新增三个环境配置文件结构统一,只有参数值不同
9. 客户端URL端口修正为8030(回测)/8020(模拟)/8010(实盘)

配置文件变更:
- configs/global.yaml:简化为仅包含current_mode
- configs/backtest.yaml:回测环境完整配置
- configs/simulation.yaml:模拟环境完整配置
- configs/production.yaml:实盘环境完整配置

代码重构:
- src/core/config.py:单例模式,自动加载环境配置
- src/core/logger.py:单例模式,类方法访问
- 所有模块:移除config/logger参数,使用单例访问
2026-01-12 19:07:23 +08:00

18 lines
412 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 策略实例配置: debug_000001
# 平安银行 - 每条K线都打印,不生成信号
instance_id: "debug_000001"
symbol: "000001.SZ"
strategy_class: "DebugStrategy"
capital: 100000
# 策略参数
params:
print_every: 1 # 每条K线都打印
simulate_signal: false # 不生成模拟信号
# 风控参数
risk:
max_position_ratio: 0.8 # 最大仓位80%
stop_loss: 0.05 # 止损5%