Home Strategy Performance Research Live Dashboard
Keystone v035.350 -- Trade Decision Pipeline F2 LightGBM (PF 1.87 | 69.5% WR) | 44 tick-level features | RTH-focused STAGE 1: TICK INPUT CME Exchange via Sierra Chart ES H6 futures tick stream via Rithmic T29-LocalBridge_v39.dll (Sierra Study) Writes: ticks_RGW.csv (seq,ms,price,bid_vol,ask_vol,total_vol) Writes: dom_RGW.csv (10 bid + 10 ask levels) | heartbeat.txt Python Bridge -- Tick Reader (20ms loop) read_last_tick_price() + read_last_dom_snapshot() No new tick: SKIP STAGE 2: FEATURE EXTRACTION FeatureEngine.feed_tick() -- compute_features() 54 Tick Features: returns (9), volatility (5), momentum (5), price context (5), microstructure (5), time (10), session (5), calendar (2), signals (3), DOM (9) + PSO update (500-tick stochastic, EMA-25) -- value -1.0 to +1.0 + Bar Aggregator: 1-min OHLCV -- 11 TA features (RSI, EMA ratio, vol ratio...) get_signal(LAST) -- delta_pts delta_pts > 0 = BUY | delta_pts < 0 = SELL delta_pts == 0: SKIP STAGE 3: MODEL INFERENCE F1 LSTM "The Founder" 5,537 params | 64.5% acc Input: (1,7,5) OHLCV bars 20 ticks/bar, 7-bar lookback -- tanh -- BUY/SELL signal F2 LightGBM "The Sniper" (2x VOTE) 54.6% acc | 69.5% WR solo | PF 1.87 Input: 54-feature vector predict_proba -- score -- STRONG_BUY/BUY/SELL signal ONNX 1m "The Workhorse" 53K params | 54.3% acc Input: (1,60,11) 1m bars 2-layer LSTM(64), 60-bar window -- sigmoid -- BUY/SELL signal 1 vote 2 votes 1 vote Ensemble Vote (4 votes: F1x1 + F2x2 + ONNXx1) consensus_score = sum(signal_values) -- BUY/SELL/NEUTRAL agreement_ratio = max(buy,sell) / total | threshold >= 25% Agreement < 25% -- BLOCK (unless PSO override) STAGE 4: AI EVALUATION Regime Detector TRENDING_UP | TRENDING_DOWN | RANGE_BOUND | LOW_VOL_QUIET | HIGH_VOL_CHOP HIGH_VOL_CHOP -- should_trade = False (hard block) Trade Quality Score + Adaptive Sizer (Kelly) quality 0-1 (should_skip if too low) | Kelly -- contracts + SizeMode (SKIP/NORMAL/BOOST/TURBO) AI Confidence Score = regime_conf x 0.20 + agreement x 0.35 + quality x 0.25 + kelly x 0.20 must be >= 0.20 to proceed AI BLOCKED regime/quality/kelly/conf STAGE 5: GATE STACK _send_order() -- 30+ Sequential Gates 1. Startup Block (10s hard lock) 2. Sync Lockout (position sync in progress) 3. Rate Limit (5s between orders, 6/min) 4. Post-Exit Cooldown (30-60s per session) 5. Anti-Hammer (same price + direction + 600s) 6. Chop Cooldown (3+ losses -- 600s pause) 7. Edge Detector (Bayesian/Kelly/CUSUM) 8. ES Calendar Blackout 9. Session Budget Killer RTH=$3000 | PRE=$350 | POST/ASIA/EUR=$350 10. Risk Shutdown (daily loss limit) 11. Smart Entry Filters (range position, VWAP) 12. Spread Filter (RTH<=1t, PRE/POST<=2t...) 13. Position Check (pyramid or flat required) 14. Momentum Opposition Check 15. Min Hold Time (30s before stop checks) 16. PSO Warmup Block (need 500 ticks) 17. Volatility / Trend Filters 18. Breakout Override (|accel| >= 8 bypasses range) 92.6% of all signals blocked here (backtest Feb 24) ANY GATE FAILS -- NO TRADE ALL PASS STAGE 6: PSO + SIZING PSO Alignment -- Size Multiplier pso_align = pso_val (BUY) or -pso_val (SELL) -- positive = momentum aligned TURBO >=0.5: 2x BOOST >=0.25: 1.5x NORMAL: 1x CONTRA <=-0.5: 0.5x Final Size = Kelly x PSO_mult x streak_adj 3+ consec losses -- force 1 lot | MAX_POSITION_QTY = 10 lots STAGE 7: ORDER EXECUTION In Position? sierra_net != 0 NO (flat) NEW ENTRY Write to orders_RGW.csv: side, qty, stop_price, target_price YES (holding) PYRAMID ADD (same direction only) Requires >=3t profit | CANCEL old brackets first Recalc avg entry, ratchet stop to protect profit DLL Reads orders_RGW.csv -- Submits to CME Market entry + OCO bracket (stop + target) DLL writes ENTRY confirmation to fills_RGW.csv STAGE 8: BRACKET STRUCTURE ENTRY TARGET +25t RTH | +16t ETH STOP -10t RTH | -12t ASIA Trail activates @ +6t 4t behind price, ratchets only BE @ R>=0.6 (6t) Pyramid Tiers +1 @ 3t (BE) +2 @ 6t (+2t lock) +2 @ 10t (+5t lock) +3 @ 15t (+8t lock) STAGE 9: EXIT MANAGEMENT ExitManager -- Evaluated Every Tick While In Position R-Multiple Rules: R >= 0.6 -- move stop to breakeven R >= 1.0 -- start trailing (5t RTH / 4t ETH) R >= 1.5 -- tight trail (3t RTH / 2t ETH) R >= 4.0 -- TAKE PROFIT (close now) Other Exit Triggers: Momentum Fade: signal drops > 0.5 while profitable Profit Drawdown: gave back >50% RTH / >40% ETH from peak Time Exit: ETH + >30min + R >= 1.0 -- close Runner Mode: accel >2.0 -- wide trail (10t RTH / 6t ETH) Signal Reversal: |pred_raw| >= 2.0 + opposite direction + profitable -- FLAT Path A: Sierra Bracket DLL auto-executes stop/target Writes EXIT to fills_RGW.csv Path B: Python FLAT ExitManager / Budget Killer / Risk Shutdown / Reversal Exit Path C: Manual / External User flatten or DLL risk mgmt Detected via heartbeat drift STAGE 10: POST-TRADE Record Trade Result Sierra EXIT line = P&L authority (v78) Update: Kelly sizer, regime win-rates, ensemble stats, session loss accumulator Post-Exit Cooldown RTH=30s | PRE=40s | POST/ASIA=60s | EUR=50s WAIT FOR NEXT TICK v035.350 deployed 2026-03-13 | 44 features | F2 LightGBM primary

What happens at each stage.

Each stage has explicit pass/fail criteria. A signal must survive all 10 stages to become an order on the exchange.

01

Tick Input

CME E-mini S&P 500 futures tick stream via Rithmic. Sierra Chart DLL writes tick CSV (price, bid/ask volume) and DOM snapshots (10 levels each side) at ~20ms resolution.

02

Feature Extraction

54 tick-level features computed on every tick: returns, volatility, momentum, microstructure, DOM imbalance, time dynamics, session context. Plus PSO oscillator and 11 bar-level TA features from 1-minute aggregation.

03

Model Inference

Three independent models vote: F1 LSTM (tick patterns, 1x vote), F2 LightGBM (54 features, 2x vote), ONNX 1m (bar patterns, 1x vote). Weighted ensemble requires minimum 25% agreement (RTH) or 40% (ETH).

04

AI Evaluation

Regime detection classifies market state. Trade quality scorer rates the signal. Kelly criterion sizes the position. AI confidence score combines all factors. Must exceed 0.20 threshold to proceed.

05

Gate Stack

30+ sequential filters: rate limits, anti-hammer, chop cooldown, edge detection, calendar blackouts, session budgets, spread filters, volatility gates. Any single failure blocks the trade. 92.6% of signals die here.

06

PSO + Sizing

Oscillator Power determines alignment tier: TURBO (2x), BOOST (1.5x), NORMAL (1x), or CONTRA (0.5x). Final size = Kelly x PSO multiplier x streak adjustment. 3+ losses forces single lot.

07

Order Execution

If flat: new entry with OCO bracket. If holding same direction: pyramid add with ratcheting stops. Orders written to CSV, DLL submits to CME exchange. Fill confirmation written back to Python bridge.

08

Bracket Structure

Exchange-managed OCO: hard stop + profit target. R-multiple trailing activates at +6 ticks, with breakeven at R=0.6. Pyramid tiers add lots at 3t, 6t, 10t, 15t with progressive profit locks.

09

Exit Management

Evaluated every tick while in position. R-multiple rules, momentum fade detection, profit drawdown limits, time exits, runner mode for strong moves, and signal reversal flat triggers.

10

Post-Trade

Record result (Sierra EXIT line is P&L authority). Update Kelly sizer, regime win-rates, ensemble statistics, session loss accumulator. Apply post-exit cooldown (30-60s by session). Wait for next tick.

30+ gates, any one kills the trade.

The gate stack is deliberately aggressive. It's cheaper to miss a good trade than to take a bad one. Each gate was added to fix a specific failure mode.

01Startup Block
10-second hard lock after bridge start. Prevents trading on stale state.
02Sync Lockout
Blocks trading while position sync is in progress between DLL and Python.
03Rate Limit
Minimum 5 seconds between orders. Maximum 6 orders per minute.
04Post-Exit Cooldown
30-60 seconds after exit before next entry. Prevents chasing.
05Anti-Hammer
Blocks same price + same direction re-entry for 600 seconds.
06Chop Cooldown
3+ consecutive losses triggers 600-second pause. Breaks loss streaks.
07Edge Detector
Bayesian/Kelly/CUSUM analysis. Only trades when statistical edge is confirmed.
08Calendar Blackout
Blocks trading during scheduled events (FOMC, NFP, CPI, etc.).
09Session Budget
Independent loss limit per session. Hit the budget, trading stops for that session.
10Risk Shutdown
Global daily loss limit. Hard kill switch that stops all trading for the day.
11Smart Entry Filters
Range position analysis and VWAP proximity checks.
12Spread Filter
Maximum spread by session: RTH 1t, Pre/Post 2t, Europe 3t, Asia 4t.
13Position Check
Must be flat for new entry, or holding same direction for pyramid add.
14Momentum Opposition
Blocks entries against strong short-term momentum.
15Min Hold Time
30-second minimum before any stop evaluation. Prevents instant stops.
16PSO Warmup
Requires 500 ticks of data before PSO values are trusted.
17Volatility / Trend
Filters based on current volatility regime and trend strength.
18Breakout Override
|accel| >= 8 bypasses range filter. Strong moves get through.