Appearance
Personalize your experience
SEBI Algo Compliance, Order-to-Trade Ratio (OTR) & Self-Trade Guard
Market FoundationsBuilding exchange-compliant execution bots with OTR rate limiting, Self-Trade Prevention, and rejection circuit breakers.
Core Architecture & Intuition
Automated trading systems must respect exchange surveillance thresholds. High Order-to-Trade Ratios (flooding the exchange with order modifications without fills) attract exchange penalty slabs, and accidental self-trades (your own buy and sell orders matching under the same PAN) violate regulatory rules.
Every production bot should sit behind a Pre-Trade Gatekeeper that enforces modification hysteresis, checks open orders for self-crosses, and halts the strategy after 3 consecutive broker rejections.
Hover over key terms below for instant definitions: Order-to-Trade Ratio (OTR), Self-Trade Prevention (STP), and Rejection Circuit Breaker. For the complete mathematical derivation and edge-case analysis, open .
Interactive Concept Breakdown
- Order-to-Trade Ratio (OTR) — Keep OTR below 15:1 by requiring at least a 2-tick price shift before modifying a resting limit order.
- Self-Trade Prevention (STP) — Essential when running multiple strategies on the same index or option strike.
- Rejection Circuit Breaker — Prevents runaway `while` loops from firing hundreds of rejected orders per minute.
Step-by-Step Execution Protocol: Regulation & Costs
- 1Add 2-Tick & 1.5s Modification HysteresisDo not modify a resting limit order for single-tick noise.
- 2Verify No Opposing Resting Order on Same StrikeCheck internal open orders table before dispatching a crossable order.
- 3Trip Kill-Switch on 3 Consecutive RejectionsMove strategy state to PAUSED and alert the operator immediately.
Parameters, Rules & Reference Matrix
| Parameter / Rule | Type | Default | Description |
|---|---|---|---|
| maxOTR | ratio | < 15 : 1 | Safe Order-to-Trade ratio target. |
| modifyMinTicks | ticks | >= 2 ticks | Minimum price change required to modify a resting order. |
| maxRejectCount | int | 3 | Consecutive rejections before halting strategy. |
Implementation & Quantitative Model
export function canDispatchOrder(consecutiveRejects: number, currentOtr: number, selfCrossDetected: boolean) { if (consecutiveRejects >= 3) return { ok: false, reason: "MAX_REJECT_CIRCUIT_BREAKER" }; if (selfCrossDetected) return { ok: false, reason: "SELF_TRADE_PREVENTION" }; if (currentOtr > 25) return { ok: false, reason: "OTR_THROTTLE_ACTIVE" }; return { ok: true, reason: "APPROVED" };}Desk Verification Checklist
Confirm before deploying live capital
- Lock state to PENDING_ACK while an order request is in flight.
- Halt bot execution automatically after 3 consecutive broker rejections.
- Check open orders for potential self-trades before submitting new orders.
Cross-reference standard risk definitions such as drawdown, slippage, and when auditing your logs.
More in Regulation & Costs
- Transaction Costs, STT, Exchange Fees & Net Breakeven Math
Exact statutory cost formulas for Indian Equity, Futures, and Options—and why ITM expiry exercise must be avoided.