[V2-VERIFY] Runtime path bypasses staged exit engine semantics #304

Closed
opened 2026-02-27 22:39:55 +09:00 by agentson · 0 comments
Collaborator

Summary

V2 exit engine is not fully applied in runtime decision path.
Current trading path hardcodes state and disables ATR/model assist inputs, causing only partial behavior (hard-stop / immediate take-profit) to execute.

Evidence

  • src/main.py:
    • current_state=PositionState.HOLDING (state machine progression not persisted)
    • peak_price=max(entry_price, current_price) (no historical peak tracking)
    • atr_value=0.0 (ATR trailing cannot trigger)
    • pred_down_prob=0.0 (model assist cannot trigger)
  • Lines around: src/main.py:1188-1201

Requirement impact

  • REQ-V2-004 violated in runtime semantics (Hard Stop/BE Lock/ATR/model assist all required)
  • REQ-V2-001/002 effectively not exercised in live path (state progression/promotion)

Expected

  • Position state should persist and promote across ticks/bars (HOLDING -> BE_LOCK -> ARMED)
  • ATR trailing and model-assist exits should be based on real inputs, not constants

Proposed fix

  1. Persist PositionState, peak_price, and stop context per open position
  2. Feed real ATR and model probability into evaluate_exit
  3. Add integration tests validating BE_LOCK/ARMED/ATR/model-assist in trading cycle
## Summary V2 exit engine is not fully applied in runtime decision path. Current trading path hardcodes state and disables ATR/model assist inputs, causing only partial behavior (hard-stop / immediate take-profit) to execute. ## Evidence - `src/main.py`: - `current_state=PositionState.HOLDING` (state machine progression not persisted) - `peak_price=max(entry_price, current_price)` (no historical peak tracking) - `atr_value=0.0` (ATR trailing cannot trigger) - `pred_down_prob=0.0` (model assist cannot trigger) - Lines around: `src/main.py:1188-1201` ## Requirement impact - REQ-V2-004 violated in runtime semantics (Hard Stop/BE Lock/ATR/model assist all required) - REQ-V2-001/002 effectively not exercised in live path (state progression/promotion) ## Expected - Position state should persist and promote across ticks/bars (HOLDING -> BE_LOCK -> ARMED) - ATR trailing and model-assist exits should be based on real inputs, not constants ## Proposed fix 1) Persist `PositionState`, `peak_price`, and stop context per open position 2) Feed real ATR and model probability into `evaluate_exit` 3) Add integration tests validating BE_LOCK/ARMED/ATR/model-assist in trading cycle
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jihoson/The-Ouroboros#304