afe361ce47
Add UI switch for Call+short/Put+long, premium x0.95 sizing, option-first open, and K+/-points exits with fee-aware net PnL. Co-authored-by: Cursor <cursoragent@cursor.com>
33 lines
1.5 KiB
Markdown
33 lines
1.5 KiB
Markdown
# 审计修复报告 · 永期「以期权为主」(2026-08-09)
|
|
|
|
## 范围
|
|
|
|
新增 `option_primary` 子模式(UI 开关 + 后端校验/开仓/监控),保险模式路径保持不变。
|
|
|
|
## 审计发现与处置
|
|
|
|
| 级别 | 问题 | 处置 |
|
|
|------|------|------|
|
|
| High | 期权已平、永续平仓失败后监控不再重试(双腿均须 open) | 增加 `_tick_po_option_primary_pending`,仅补平永续 |
|
|
| High | 双目标触达时期权路径因买一/净利跳过,永续目标永不执行 | 期权路径失败且 `hit_perp` 时 fallthrough 永续目标 |
|
|
| High | 两腿仍 open 但期权到期无处理,裸奔永续 | `_tick_po_option_primary_both_expired` 结算期权并平永续 |
|
|
| High | 目标点数=0 开仓后易立即触发 | 校验与 `target_hit` 要求点数 **>0** |
|
|
| Medium | start 未传 leverage 时被写成 10x | 期权为主缺省杠杆 **100** |
|
|
| Medium | 服务端 `moneyness=atm` 未强制 ATM | 文档注明;UI 平值筛选仍严格;间隔门兜底 |
|
|
| Medium | 平仓永续盈亏用估价 | 已知;不阻塞平仓,统计近似 |
|
|
|
|
## 保险模式回归
|
|
|
|
- `validate_start_body` 非 `option_primary` 仍强制 Put/Call + TP/SL 几何
|
|
- `build_po_path_plan` 仅在 `option_primary` 时翻转永续方向并去掉 attach_tpsl
|
|
- `_tick_po` 仅在 `option_primary` 为假时走原 TP/SL 路径
|
|
|
|
## 测试
|
|
|
|
`python -m unittest tests.test_hedge_plan_option_primary tests.test_hedge_plan_orders tests.test_hedge_plan_moneyness -v` — 通过。
|
|
|
|
## 文档
|
|
|
|
- 新增 `docs/对冲计划-以期权为主.md`
|
|
- 更新 `docs/对冲计划-选约与虚实值.md`
|