NEO Trading Engine — Implementation Log¶
Running record of all engine code changes. One entry per feature/fix/phase implementation.
Format per entry (Atlas's required return format): 1. SUMMARY — what it does, one paragraph 2. FILES_CHANGED — exact files touched 3. EXACT_CHANGE — behavior rule / logic implemented 4. HOW_TO_VERIFY — startup checks, runtime signals 5. UNAPPROVED_FINDINGS — anything unexpected or out of scope 6. COMMITS — git SHAs in order
2026-04-15 — Phase 6A: Momentum-Aware One-Sided Participation Filter¶
SUMMARY Engine now computes short-term price momentum from rolling mid-price history and suppresses one side of quoting when momentum exceeds threshold. Rising price suppresses SELL; falling price suppresses BUY. First adaptive behavioral layer — addresses the "skew is inventory-driven, market is momentum-driven" misalignment identified in Session 26 stress test where cap engagement drove VW to zero.
FILES_CHANGED
- neo_engine/config.py — added momentum_filter_enabled, momentum_lookback_ticks, momentum_threshold_bps to StrategyConfig; parser; validation (lookback ≥ 1, threshold > 0)
- config/config_live_stage1.yaml — added three fields under strategy: with live defaults true / 3 / 4.0
- neo_engine/strategy_engine.py — rolling _momentum_history deque (maxlen = lookback + 1), suppression counters, momentum computation in calculate_quote(), one-sided intent gates, INFO log per trigger, counter fields in tick debug log
EXACT_CHANGE
Behavioral rule:
momentum_bps = ((mid_now − mid_lookback) / mid_lookback) * 10000
IF momentum_bps >= +threshold → suppress SELL (price rising, avoid selling into rise)
IF momentum_bps <= -threshold → suppress BUY (price falling, avoid buying into drop)
ELSE → normal quoting
Implementation specifics:
- Filter gates intent generation only — skew math, anchor logic, offset computation, execution engine all unchanged
- Suppression = full side suppression (not partial size reduction) — v1 minimal, cleaner to evaluate
- Filter only evaluates once deque is full (no false triggers from partial history)
- When momentum_filter_enabled: false, branch never enters — system behaves identically to pre-6A
- Session counters: _momentum_buy_suppressions, _momentum_sell_suppressions — exposed in tick debug log
HOW_TO_VERIFY
Startup log should include:
During a session with price movement ≥4 bps over 3 ticks (~12s), INFO log entries appear:
Momentum filter triggered: suppress SELL
momentum_bps=+5.2 threshold_bps=4.0 suppressed_side=sell drift_pct=+X.X mid_price=Y.YYY
Per-tick DEBUG log includes running fields momentum_bps, momentum_suppressed_side, momentum_buy_suppressions_total, momentum_sell_suppressions_total.
To verify disabled state: set momentum_filter_enabled: false in YAML — engine behaves exactly as before, no INFO triggers, no suppression counts.
Recommended first run plan: 1. Restart engine — verify startup log shows the three new fields with expected values 2. Run 1-hour session — check for INFO triggers during any XRP price moves 3. Compare session outcome (VW, fills, toxicity) against Session 26 (stress test) for a matched stress scenario
UNAPPROVED_FINDINGS
- INTEL/ folder is untracked (intel notes directory). Not staged, not touched. Status unchanged.
- No unintended modifications. All edits confined to the three files declared above.
COMMITS
1. ab6404d — Add momentum filter config fields and parsing
2. 0cce74e — Add momentum-based one-sided participation filter
3. 32fc26a — Add momentum filter suppression counters to tick log
ATLAS_SPEC_REFERENCE: Phase 6A — Momentum-Aware Participation Filter (2026-04-15)
Template for next entry below