Commit Graph

2 Commits

Author SHA1 Message Date
30ea2970bd refactor(framework): 框架只保留抽象接口,具体实现移至strategies/shared
- FactorBase/FactorRegistry/FactorCombiner: 因子抽象接口
- SignalGenerator: 信号生成抽象接口
- RiskControl/Position/CallbackHook: 风控抽象接口
- StrategyBase: 策略抽象基类
- Executor/Portfolio: 执行器抽象接口
- ConfigLoader: 配置加载器
- 删除framework/factors/momentum.py(具体实现)
2026-05-11 23:09:01 +08:00
512b73ac04 feat(risk): 实现风控层与回调钩子机制(融合Freqtrade设计)
核心组件:
- RiskControl: 风控抽象基类
- StopLossControl: 止损控制(固定止损/跟踪止损)
- PositionLimitControl: 仓位限制控制
- PremiumControl: 溢价控制(filter/penalize模式)

回调钩子机制:
- CallbackHook: 回调管理器(注册/触发)
- 5个核心回调:before_entry, after_entry, before_exit, after_exit, dynamic_stoploss, custom_exit

便捷回调函数:
- premium_filter_callback: 溢价过滤回调
- crash_filter_callback: 崩盘检测回调
- holding_time_stoploss_callback: 持仓时间动态止损

测试覆盖:13个测试全部通过
2026-05-11 22:18:41 +08:00