mirror of
https://github.com/silencesdg/mt5_python_ea_suite.git
synced 2026-07-28 11:17:43 +00:00
9b0eeb521e
- _calculate_pnl_pct: 从金价涨跌%改为账户余额% - _get_contract_size: 新增缓存合约规格方法 - 硬止损: 从金价%乘法改为账户$→点数→价格转换 - 拖尾止损: peak*(1-retrace) 改为 peak-retrace(绝对值扣除) - 统一 _record_closed_trade/_calculate_unrealized_pnl 使用缓存合约规格 - RISK_CONFIG: 止损-1.5%/止盈+3.0%/拖尾激活+2.0%/回撤1.0%(均为账户%)
风险管理模块
此模块包含所有风险管理相关的组件:
market_state.py: 市场状态分析器,基于resilient_trend逻辑position_manager.py: 仓位管理器,基于profit_protect逻辑__init__.py: 风险管理控制器,统一接口