Mifid Rts6 Pretrade Kill Switch Controls
Runaway Loop & Quote-Stuffing Detection: Stateful Duplicate-Order & Reject-Storm Gates
Simple message-per-second rate limiters cannot distinguish healthy FOMC quoting from a fatal Knight-style infinite retry loop; stateful 64-bit tuple hash rings and reject-loop counters stop toxic bursts in 4 ticks.

Generic 1,000 messages/second token buckets fail to stop the most destructive failure pattern in algorithmic trading: a slow-or-medium-rate infinite retry loop firing 80 identical 500-share orders per second because an ExecutionReport parser misread a reject reason or dropped a CumQty increment! Both SEC Rule 15c3-5(c)(1)(ii) ("prevent the entry of erroneous orders, by rejecting orders that... indicate duplicative orders") and MiFID II RTS 6 Article 15 mandate stateful Duplicate-Order, Reject-Storm, and Ping-Pong Oscillation Detectors.
Anatomy of Four Classic Runaway Algorithmic Loop Pathologies#
Reviewing exchange post-mortems and FINRA disciplinary files (cataloged in our MiFID II RTS 6 & SEC 15c3-5 Architecture Hub), runaway loops almost always fall into four deterministic state-machine signatures:
- Machine-Gun Identical Clone Loop: Strategy fails to record outbound
PendingNewstate in local memory; on the next100 usmarket-data tick, it checksCurrent_Pos != Target_Posand fires the exact same(Symbol, Side, Qty, Price)order 400 times in 40 milliseconds! - Infinite Reject-Retry Storm: Exchange rejects an order (
35=8, 39=8, e.g., invalidMinQtyor halted symbol); the strategy event handler marks the orderDead, seesTarget_Posstill unfilled, and re-submits the exact rejected order in an infinite tight loop (10,000 rejects/sec)! - Two-Tick Ping-Pong ("Flicker") Oscillation: Rounding bug or cross-pod feedback causes
Cancel/Replace (35=G)to alternate endlessly betweenBid = 100.01 -> 100.02 -> 100.01 -> 100.02every200 microseconds—constituting manipulative Quote Stuffing under SEC / MAR surveillance! - Fill-Blindness ("PowerPeg") Loop: Strategy ignores
CumQtyincrements (or subtracts instead of adding!), selling new clips every time the previous clip fills.
O(1) Hardware/C++ Ring-Buffer Hash Fingerprinting for Duplicate Detection#
Inside a Disruptor C++ gateway or inline cut-through FPGA implementing the Pre-Trade Risk Control Standard, duplicate detection runs in < 40 nanoseconds with zero heap allocation:
- Compute a fast hardware 64-bit
CRC32C / xxHash64tuple fingerprint:H = Hash64(AccountID, SymbolID, Side, OrdType, Quantized_Qty, Price_Ticks). - Index a lock-free
4,096-slotopen-addressed ring table storing{Hash64, Window_Start_Ns, Hit_Count}. - Rule 1 (
Identical Tuple Cap): IfHit_Countfor exactHexceedsN_dup_max(e.g.5 identical orders) withinW_dup(500 ms), trip an immediate Symbol Freeze! - Rule 2 (
Consecutive Reject Breaker): MaintainConsecutive_Reject_Count[Symbol]; if any symbol accumulates>= 4 consecutive venue/gateway rejectswithin2,000 mswithout an intervening valid resting/fill event, hard-lock that symbol and alert desk engineering!
| Loop Pathology | Signature Pattern | Exact Stateful Trigger Rule | Automated Gateway Action |
|---|---|---|---|
| Pending-Blind Clone Burst | Identical (Sym, Side, Qty, Px, MIC) while prior unacked | >= 5 identical tuples within 500 ms (Unacked >= 3) | Reject #5 + Freeze Symbol |
| Tight Reject-Retry Storm | Repeated 35=8 (39=8) or 35=9 without valid fill/rest | >= 4 consecutive rejects on symbol within 2,000 ms | Hard-Lock Symbol (Saves OTR quota!) |
| A-B-A-B Quote Flicker | 35=G toggling between two prices P1 <-> P2 | >= 8 alternating sign reversals on dPrice in 250 ms | Reject 35=G + Fire 35=q Symbol Cancel |
| Knight-Style Fill Runaway | Continuous single-side aggressive fills eating inventory | Executed notional in 10s exceeds 3x strategy 99.9% clip | Strategy Kill Switch + Clearing Alert |
Stateful Loop Detector Threshold & Action Reference Matrix#
Recommended production detection signatures, sliding-window thresholds, and automated circuit-breaker responses.
- PingPongOscillation_Score(t):
- Let sk = SIGN( PriceReplacek - PriceReplace_{k-1} ) in {-1, +1}
- FlipCount(W = 250ms) = Sum{k in [t - 250ms, t]} I( sk == -s{k-1} )
- Trigger Quote-Stuffing Halt IFF FlipCount(250ms) >= 8 AND ExecutedVolume(250ms) == 0!
Distinguishing Legitimate Iceberg / Sweep Slicing From Runaway Clones#
Wait: what if an institutional TWAP/SOR intentionally slices a 5,000-share parent order into ten legitimate 500-share child orders across Nasdaq, NYSE, and Cboe at $185.20?
- Venue Differentiation: Including
Destination_Venue_IDinside the tuple hash allows simultaneous1 x 500sh @ Nasdaq + 1 x 500sh @ NYSE + 1 x 500sh @ Cboe(Count = 1per venue!) while blocking10 x 500sh @ Nasdaqin1 millisecond! - Sequential Fill-Gated Reloading: A legitimate synthetic iceberg reloads child
#2only AFTER child#1returns39=2 (Filled)or39=4 (IOC Canceled), whereas a runaway bug blasts15unacknowledgedPendingNewclones back-to-back beforeACK #1even returns!
Coupling Loop Detectors to Out-of-Band 35=q Kill Switches#
When a Ping-Pong Oscillation or Fill-Blindness loop trips, blocking future orders is half the job—the gateway immediately dispatches an OrderMassActionRequest (35=q) on its dedicated purge lane and logs full pre-breach telemetry for CAT & MiFID RTS 24 audit trails.
Bound maximum per-minute child-order velocity against strategy edge using our Algorithmic Kelly Allocation Calculator and cap worst-case runaway notional in the Terminal Margin VaR & ES Calculator.
Frequently asked questions
Why did Knight Capital 2012 runaway PowerPeg algorithm evade standard message-rate limits?
PowerPeg did not flood millions of messages in one millisecond; it steadily fired ~1,500 child orders per second across 148 NYSE stocks for 45 straight minutes because a dead code path subtracted filled shares from cumulative quantity instead of adding them—never reaching its target stop condition!
How do we prevent our duplicate-order gate from blocking a trader manually clicking "Buy 100" six times in a row?
Scope strict sub-second duplicate caps (e.g., >4 identical orders in 500ms with >=3 unacknowledged) to automated low-latency sessions, while still capping human GUI click bursts at e.g. >3 clicks within 300ms (catching stuck Enter keys or double-click GUI bugs!).
Why must a tripped Runaway-Loop Breaker NEVER auto-reset after 60 seconds?
If a strategy has an infinite while-true bug in memory and the risk gateway auto-unlocks after a 60-second cooldown, the strategy will immediately blast another burst every 60 seconds all day long! Require explicit human Risk/Ops clearance after killing the faulty process.
Does SEC Rule 15c3-5 explicitly mention "duplicative orders" in the federal rule text?
Yes! SEC Rule 15c3-5(c)(1)(ii) and its adopting release (34-63241) explicitly cite "rejecting orders that indicate duplicative orders" as a core mandatory element of erroneous-order financial risk controls.
Publication record
- Published
- 13 November 2026
- Updated
- 15 November 2026
- Author
- Marcus Thorne, CQF
- Review
- Review not recorded
- Automated fact check
- Passed in the stored pipeline record
- Source URLs
- 3 recorded
AI assistance recorded: anthropic/claude-opus-4.6. This field does not establish human review or source verification.
Academic & Institutional Attribution
Cite This Research & Embed Live Data Card
Standard academic & institutional research paper citation format.
Marcus Thorne, CQF. (2026, November 15). Runaway Loop & Quote-Stuffing Detection: Stateful Duplicate-Order & Reject-Storm Gates. Terminal Ledger Desk. https://terminalledgerdesk.com/reports/runaway-loop-quote-stuffing-detection-stateful-duplicate-order-gateRelated Mifid Rts6 Pretrade Kill Switch Controls & Institutional Briefings
Explore Mifid Rts6 Pretrade Kill Switch Controls Hub (20) →Mifid Rts6 Pretrade Kill Switch Controls
MiFID II RTS 6, SEC Rule 15c3-5 Market Access & Inline Pre-Trade Kill-Switch Architecture GuideMifid Rts6 Pretrade Kill Switch Controls
SEC Regulation SHO Pre-Trade Gates: Rule 203(b) Locate Accounting & Rule 201 Short-Sale Circuit BreakersMifid Rts6 Pretrade Kill Switch Controls
Drop-Copy Shadow Kill Switches: Out-of-Band Clearing Risk Monitors & Session Disconnect ArchitectureMifid Rts6 Pretrade Kill Switch Controls
Algorithmic Trading Software Deployment Gates: Canary Releases, SHA-256 Attestation & Config DiffsMifid Rts6 Pretrade Kill Switch Controls
UK FCA MAR 7A & PRA SS5/18 Algorithmic Trading Governance: SM&CR Accountability & MaterialityMifid Rts6 Pretrade Kill Switch Controls
Consolidated Audit Trail (CAT) & MiFID II RTS 24: Nanosecond Order-Lifecycle Telemetry EngineeringMifid Rts6 Pretrade Kill Switch Controls
SEC Rule 15c3-5 Market Access Control: Ban on Unfiltered Sponsored Access & Annual CEO AttestationMifid Rts6 Pretrade Kill Switch Controls
MiFID II RTS 6 Compliance: Annual Self-Assessment, 2x Stress Testing & DEA GovernanceReg Sci Disaster Recovery Outage Rca
EU DORA (Regulation 2022/2554) vs US SEC Regulation SCI: Global ICT Operational Resilience ComparedReg Sci Disaster Recovery Outage Rca
Clearing House (CCP) FIXML Trade-Capture Backlog Recovery: Post-Spike Compression & NettingReg Sci Disaster Recovery Outage Rca
BGP Anycast & DNS TTL Pitfalls During Broker & Exchange Gateway Disaster-Recovery CutoversReg Sci Disaster Recovery Outage Rca
Chaos Engineering & Deterministic Fault Injection in Staging Matching & Gateway Clusters
Terminal Ledger Desk Data, Benchmarks & Contributor Records
CC BY 4.0 Open Data
Open Institutional Datasets (CSV / JSON) →
Download desk-compiled quantitative series & schemas.
2026 Reference Matrix
2026 Institutional Benchmarks & Thresholds →
Statutory capital, clearing, margin & rate conventions.
Editorial Records
Authors & Review Records →
View named contributors where those records are available.
Complete Index
Master Research & Dossier Archive →
Browse all published briefings by topic pillar & date.
