Beta套利止盈止损算法说明
Beta套利止盈止损算法说明 架构概览 监控线程 (_stop_loss_monitor) │ 每 3 秒循环一次 │ ├─ 1. update_position_prices() ← 从 WS L2缓存/REST API 获取最新价格 ├─ 2. calculate_pnl() ← 计算组合 PnL ├─ 3. check_stop_loss() ← 固定止损检查 ├─ 4. check_trailing_stop() ← 移动止盈检查 ├─ 5. check_max_hold_duration() ← 持仓超时检查 └─ 6. _close_with_retry() ← 触发平仓(带重试) 检查优先级:Kill Switch >