feat: v_mr 均值回复策略 v2——10y全市场验证通过(21690笔/53.6%WR/avg+3.34%)
- 独立均值回复引擎: MA60下>10%+RSI≤42+60日跌>15%+小盘≤1500万+RSI止跌≥2 - 出场: 止盈+18%/止损-8%/25天, 移除MA20反弹截断(v1毒药) - backtest_framework: prepare_bars 补 amount 字段(千元) - 大盘上下文: sh000001 2016-2020 数据从 sector_index_daily 回填 stock_daily - 验证: sideways(ADX)过滤有害(206.6%→147.9%), mkt_mode=any 最优 - docs/v_mr_strategy.md 完整策略文档
This commit is contained in:
@@ -158,6 +158,7 @@ def prepare_bars(code, start_date, end_date):
|
||||
highs = [r[3] for r in rows]
|
||||
lows = [r[4] for r in rows]
|
||||
volumes = [r[5] for r in rows]
|
||||
amounts = [r[6] if len(r) > 6 else None for r in rows]
|
||||
|
||||
# 计算全部指标
|
||||
ma5 = calc_ma(closes, 5)
|
||||
@@ -203,6 +204,7 @@ def prepare_bars(code, start_date, end_date):
|
||||
'high': highs[i],
|
||||
'low': lows[i],
|
||||
'volume': volumes[i],
|
||||
'amount': amounts[i] if i < len(amounts) else None,
|
||||
'ma5': ma5[i] if i < len(ma5) else None,
|
||||
'ma10': ma10[i] if i < len(ma10) else None,
|
||||
'ma20': ma20[i] if i < len(ma20) else None,
|
||||
|
||||
Reference in New Issue
Block a user