⚡ Core Pillar IV: Intraday Execution & Trailing Risk Control: VWAP Navigator, Volume Breakout & Dynamic Trailing Stop#
Release Version: v6.9.0 & v7.2.0
Core Components:core/trailing_stop.py,core/breakout_detector.py,intraday_orchestrator.py
Tags:VWAP Navigation·Volume Breakout·Dynamic Trailing Stop·Layer 5 Risk Control
📖 Introduction: Achieving Intraday Micro-Execution & Profit Locking#
Daily trend analysis determines the macro direction of trades, but real trading PnL often hinges on intraday entry timing and exit risk controls. Traders regularly face two main dilemmas:
- Unrealized Gains Turning into Losses: A stock surges 20% but sharply reverses, resulting in a breakeven or loss due to lack of automated trailing stops.
- Chasing Highs Intraday: Buying at the peak during high intraday volatility or without broad market volume confirmation.
From v6.9.0’s Intraday Trading Navigator to v7.2.0’s Trade Ideas grade volume breakout and trailing stop engine, Trade OS has established a comprehensive intraday micro-execution and trailing risk management architecture.
🛡️ I. Trade Ideas Grade Dynamic Trailing Stop Engine#
TrailingStopEngine (core/trailing_stop.py) enables persistent tracking for unrealized gain protection.
1.1 Peak High Tracking & Activation Conditions#
The system persistently records each position’s historical peak price ($P_{\text{peak}}$) post-entry.
# Core Trailing Stop Calculation (core/trailing_stop.py)
gain_pct = (current_price - avg_cost) / avg_cost
# 1. Floating profit >= +10% activates 5% dynamic trailing stop
if gain_pct >= 0.10:
stop_price = peak_high * (1 - 0.05) # Dynamic stop locked at 5% drawdown from peak
if current_price <= stop_price:
trigger_signal = "🚨 TRAILING-STOP-TRIGGERED" # Trigger profit taking exitPrice Trajectory ──► Entry ($100) ──► Peak High ($130) ──► Retracement to Stop ($123.5)
│ │
+30% Gain Activates Lock +23.5% Profit!Through this mechanism, the system strictly locks in existing profits, eliminating emotional hesitation during sharp pullbacks.
🚀 II. Intraday Volume Breakout & Anomaly Detection (Breakout Detector)#
BreakoutDetector (core/breakout_detector.py) calculates real-time volume expansion ratios ($R_{\text{vol}}$) and key structural breakouts during market hours.
2.1 Three Core Anomaly Signals#
# Anomaly Detection Logic (core/breakout_detector.py)
volume_ratio = current_volume / avg_20d_volume
if price >= high_52w and volume_ratio >= 1.5:
tag = "🚀 52W-HIGH-BREAKOUT" # 52-week high volume breakout
elif price >= max_close_20d and volume_ratio >= 2.0:
tag = "🚀 VOLUME-BREAKOUT" # 20-day channel volume breakout
elif price <= min_close_20d and volume_ratio >= 1.5:
tag = "🚨 VOLUME-BREAKDOWN" # 20-day breakdown below supportWhen scanning 🚀 52W-HIGH-BREAKOUT or 🚀 VOLUME-BREAKOUT, the console highlights actionable setups and connects to express order execution.
📟 III. V6 Smart Intraday Trading Navigator & Layer 5 Risk Control#
First introduced in v6.9.0, the Intraday Trading Navigator establishes a top-down execution funnel:
graph TD
A[Intraday Order Book 15-Min Candle] --> B[VWAP Bull/Bear Axis Solver]
B --> C{Detect Volatility Mode}
C -- High Volatility TSLA/NVDA --> D[Adaptive Expansion of ORB Stop Band]
C -- Low Volatility VDY/XIC --> E[Tighten ORB Stop Band]
D & E --> F{Check Daily No-Trade Red Zone}
F -- Triggered QQQ < VWAP or RVOL < 1.5x --> G[🛑 ZERO POSITION / NO TRADE]
F -- Normal --> H[🛡️ Layer 5 Risk Sizing Matrix]
H --> I[Standard Full / Probe Half / Tactical Core Quarter]3.1 Layer 5 Position Sizing Matrix#
Macro and intraday conditions jointly constrain maximum position sizing:
- Standard (Full): Daily buy signal + Intraday above VWAP + Volume breakout.
- Probe (Half): Pullback to support zone without strong volume confirmation.
- Tactical Core (Quarter): Left-side tactical accumulation.
- Zero Position (No-Trade Funnel): Macro event window or opening flash crash (intraday swing > 4.5%).
💡 Summary & Architectural Significance#
The intraday execution and trailing risk engine bridges macro conviction with micro execution. Powered by TrailingStopEngine (core/trailing_stop.py) and BreakoutDetector (core/breakout_detector.py), Trade OS ensures every entry is shielded by strict risk controls and every floating profit is backed by automated exit discipline.