trading.ai/config/config.yaml
aaron 77ecaefbc2 修复搜索功能并取消月线筛查
功能修复:
- 修复股票搜索功能: 'Info' object has no attribute 'search' 错误
- 使用本地股票列表实现搜索,支持代码和名称模糊匹配
- 搜索功能现在支持中文股票名称和股票代码搜索

配置优化:
- 取消月线筛查: 从配置中移除monthly时间周期
- 更新默认时间周期: 仅保留daily和weekly
- 提高扫描效率,专注于更及时的交易机会

技术改进:
- 实现基于pandas的本地搜索算法
- 支持不区分大小写的模糊匹配
- 完善错误处理和日志记录
- 保持API兼容性

测试验证:
- 搜索'平安'返回3个相关股票
- 支持按股票代码和名称搜索
- 错误处理机制正常工作

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 21:25:29 +08:00

98 lines
2.9 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.

# A股量化交易配置文件
trading:
# 交易时间配置
trading_hours:
start: "09:30:00"
end: "15:00:00"
lunch_break_start: "11:30:00"
lunch_break_end: "13:00:00"
# 股票池配置
stock_pool:
# 默认关注的指数成分股
index_codes: ["000001.SZ", "000300.SZ", "000905.SZ"] # 上证指数、沪深300、中证500
# 排除的股票代码
exclude_codes: []
# 风险控制
risk_management:
max_position_per_stock: 0.05 # 单股最大仓位比例
max_total_position: 0.9 # 最大总仓位比例
stop_loss_ratio: 0.05 # 止损比例
take_profit_ratio: 0.15 # 止盈比例
# 数据配置
data:
# 数据源配置
sources:
primary: "adata"
# 数据更新频率
update_frequency:
realtime: "1min" # 实时数据更新频率
daily: "after_close" # 日线数据更新时机
# 数据存储
storage:
path: "data/"
format: "parquet" # 数据存储格式
# 策略配置
strategy:
# 技术指标参数
indicators:
ma_periods: [5, 10, 20, 50] # 移动平均线周期
rsi_period: 14 # RSI周期
macd_params: [12, 26, 9] # MACD参数
# 选股条件
selection_criteria:
min_market_cap: 1000000000 # 最小市值(元)
max_pe_ratio: 30 # 最大市盈率
min_volume_ratio: 1.5 # 最小成交量比率
# K线形态策略配置
kline_pattern:
enabled: true # 是否启用K线形态策略
min_entity_ratio: 0.55 # 前两根阳线实体最小占振幅比例55%
final_yang_min_ratio: 0.40 # 最后阳线实体最小占振幅比例40%
timeframes: ["daily", "weekly"] # 支持的时间周期
scan_stocks_count: 1000 # 扫描股票数量限制
analysis_days: 60 # 分析的历史天数
# 监控配置
monitor:
# 实时监控
realtime:
enabled: true
refresh_interval: 60 # 刷新间隔(秒)
# 报警配置
alerts:
price_change_threshold: 0.05 # 价格变动报警阈值
volume_spike_threshold: 3.0 # 成交量异常报警阈值
# 日志配置
logging:
level: "INFO"
format: "{time:YYYY-MM-DD HH:mm:ss} | {level} | {name} | {message}"
rotation: "1 day"
retention: "30 days"
file_path: "logs/trading.log"
# 通知配置
notification:
# 钉钉机器人配置
dingtalk:
enabled: true # 是否启用钉钉通知
webhook_url: "https://oapi.dingtalk.com/robot/send?access_token=50ad2c14e3c8bf7e262ba837dc2a35cb420228ee4165abd69a9e678c901e120e" # 钉钉机器人webhook地址需要用户配置
secret: "SEC6e9dbd71d4addd2c4e673fb72d686293b342da5ae48da2f8ec788a68de99f981" # 加签密钥
at_all: false # 是否@所有人
at_mobiles: [] # @指定手机号列表
# 其他通知方式
email:
enabled: false # 邮件通知(预留)
wechat:
enabled: false # 微信通知(预留)