QTrade/configs/global.yaml
cuizhan a5ac1c846e feat: 添加MA(移动平均线)指标计算器
主要更新:
- 新增 src/indicator_calculator/ma_indicator.py: MA指标计算器,支持自定义周期列表
- 更新 src/core/constants.py: 添加MA相关常量(IndicatorType.MA, IndicatorColumns.MA_*)
- 更新 src/indicator_calculator/indicator_manager.py: 注册MA指标到管理器
- 更新 configs/global.yaml: 添加MA指标配置(periods: [5, 10, 20, 60])

功能特点:
- 使用ta-lib库计算SMA(简单移动平均线)
- 支持多周期同时计算
- 遵循常量命名规范
- 与IndicatorManager和DataService完整集成
- 自动保存到indicators_1d_ma表

测试:
- test_ma_indicator.py: MA指标单元测试
- test_ma_dataservice.py: DataService集成测试
2025-12-23 18:07:18 +08:00

135 lines
3.0 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 全局公共配置
# 说明: 此文件包含所有服务共用的配置项
# 环境变量配置(对应 .env 文件内容)
environment:
# 当前环境: backtest, simulation, production
env: "backtest"
# 配置文件路径
config_file: "configs/backtest.yaml"
# 环境对应的配置文件映射
config_mapping:
backtest: "configs/backtest.yaml"
simulation: "configs/simulation.yaml"
production: "configs/production.yaml"
# 应用配置
app:
version: "2.0.0" # 公用版本号
# MySQL 配置(公用)
database:
host: "127.0.0.1"
port: 3306
user: "root"
password: "1234"
pool_size: 5
pool_recycle: 3600
echo: false
# 日志配置(公用)
logging:
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
file:
enabled: true
max_size: 10485760 # 10MB
backup_count: 5
# 数据源配置(公用)
data_source:
# 数据下载器类型: xtquant, qmt, tushare, akshare 等
downloader: "xtquant"
# XtQuant 下载器配置
xtquant:
xtquant_path: "C:\\Program Files\\国金证券QMT交易端\\userdata_mini\\datadir"
xtquant_token: "e83d8eec5226c0b4db4a1d40830e09e4ffe73e15" # XtQuant 数据接口 token(需要申请)
# XtQuant 优化地址(可选,用于提升数据下载速度)
optimize_addresses:
- "115.231.218.73:55310"
- "115.231.218.79:55310"
- "218.16.123.11:55310"
- "218.16.123.27:55310"
# 未来扩展:其他下载器配置
# qmt:
# ...
# tushare:
# token: "your_token_here"
# 数据检查器配置
data_checker:
# 报告配置
report:
enabled: false # 是否启用报告生成(默认关闭)
directory: "reports/datacheck" # 报告保存目录
# 行情配置(公用)
market:
kline_periods:
- "tick"
- "1m"
- "5m"
- "15m"
- "30m"
- "60m"
- "1d"
- "1w"
cache_ttl: 60
# 技术指标配置(公用)
indicators:
# 是否启用指标计算
enabled: true
# 要计算的指标列表
# 支持的指标类型: macd, kdj, boll, rsi, ma
enabled_indicators:
- macd
- kdj
- boll
- rsi
- ma
# 各指标的参数配置
macd:
fast_period: 6 # 快速EMA周期
slow_period: 13 # 慢速EMA周期
signal_period: 5 # 信号线周期
kdj:
period: 9 # RSV计算周期
k_period: 3 # K值平滑周期
d_period: 3 # D值平滑周期
boll:
period: 20 # 移动平均周期
std_multiplier: 2.0 # 标准差倍数
rsi:
fast: 6 # 快速RSI周期
mid: 12 # 中速RSI周期
slow: 24 # 慢速RSI周期
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"
# QMT交易配置(公用部分)
qmt:
account_type: "STOCK" # STOCK-股票账户, CREDIT-信用账户