QTrade/configs/production.yaml
cuizhan 593565bb36 feat: 完善交易系统和实盘模块
核心改进:
- Account模型重命名为Asset,增加完整资产管理字段
- Logger增加prompt_level列表过滤,支持灵活日志级别控制
- 新增TradingDataStorage和TradingCache,完善交易对象存储
- 实现MiniQMTClientAdapter实盘交易适配器
- 新增realtrade_runner.py实盘启动脚本

数据库表更新:
- 重构Order/Trade/Position/Asset表结构
- 所有交易表增加instance_id字段实现多策略隔离
- Signal表增加instance_id字段

文档完善:
- 新增logger_prompt_level_guide.md日志配置说明
- 新增realtrade_guide.md实盘交易使用指南
- 新增table_cleanup_summary.md表结构清理总结

代码优化:
- 全局WSClient使用get_wsclient()函数封装访问
- 移除Symbol模型,信息移至配置文件
- 清理废弃表定义约320行代码
2026-01-15 22:11:28 +08:00

117 lines
2.7 KiB
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.

# QTrade 实盘环境配置文件
# ==================== 环境配置 ====================
environment:
mode: "production"
# ==================== MySQL 配置 ====================
database:
host: "127.0.0.1"
port: 3306
user: "root"
password: "1234"
database: "qtrade_live"
pool_size: 5
pool_recycle: 3600
echo: false
# ==================== 缓存配置 ====================
cache:
type: "memory" # memory-内存缓存
max_memory_mb: 4096 # 最大内存限制 4GB
# ==================== 日志配置 ====================
logging:
enabled: true
prompt_level: ["ERROR", "WARNING", "INFO"]
filepath: "d:\\workspace\\QTrade\\logs"
max_size: 10485760 # 10MB
backup_count: 5
path: "logs/production"
# ==================== 策略配置 ====================
strategies:
strategy_folder: "d:/workspace/QTrade/configs/strategies"
max_concurrent_strategies: 50
# ==================== 客户端适配器配置 ====================
client_adapters:
production_adapter:
server_url: "ws://localhost:8010/ws/strategy"
timeout: 30 # seconds
# ==================== MiniQMT 实盘交易配置 ====================
miniqmt:
userdata_path: "D:\\国金QMT交易端模拟\\userdata_mini" # MiniQMT userdata_mini 路径
session_id: 123456 # 会话ID(不同策略使用不同ID)
account:
account_id: "40004091" # 交易账号
account_type: "STOCK" # 账户类型(STOCK/HUGANGTONG/SHENGANGTONG)
# ==================== 下载数据源配置 ====================
data_downloader:
downloader: "xtquant"
xtquant:
xtquant_path: "C:\\Program Files\\国金证券QMT交易端\\userdata_mini\\datadir"
xtquant_token: "e83d8eec5226c0b4db4a1d40830e09e4ffe73e15"
optimize_addresses:
- "115.231.218.73:55310"
- "115.231.218.79:55310"
- "218.16.123.11:55310"
- "218.16.123.27:55310"
# ==================== 行情配置 ====================
market:
kline_periods:
- "tick"
- "1m"
- "5m"
- "15m"
- "30m"
- "60m"
- "1d"
- "1w"
# ==================== 技术指标配置 ====================
indicators:
enabled: true
enabled_indicators:
- macd
- kdj
- boll
- rsi
- ma
macd:
fast_period: 6
slow_period: 13
signal_period: 5
kdj:
period: 9
k_period: 3
d_period: 3
boll:
period: 20
std_multiplier: 2.0
rsi:
fast: 6
mid: 12
slow: 24
ma:
periods: [5, 10, 20, 60]
# ==================== 交易配置 ====================
trading:
sessions:
morning:
start: "09:30"
end: "11:30"
afternoon:
start: "13:00"
end: "15:00"
# ==================== 服务端口配置 ====================
services:
trading_service:
host: "0.0.0.0"
port: 8010