Risk priority
01Fresh dataStop evaluation requires a current option quote. Stale feeds block new entries and raise an operational alert.
02Protective stopMandatory 25% premium guard. Immediate and evaluated before strategy logic.
03Active TSLImmediate tick evaluation after activation. It only ratchets toward profit.
04Fixed SLUses an independent option-risk candle and consecutive close confirmation.
05Strategy invalidationSuperTrend reversal is checked on the selected underlying signal candle.
06Session RMSTrade limits, cooldown, daily controls, cutoff, persistence, and audit.
STOT stop simulator
Fixed strategy SL175.51
Immediate protective SL199.44
Fixed confirmation2 closes
Continuous breach limit60 sec
A SELL premium position is losing when premium rises. A BUY premium position is losing when premium falls.
What SuperTrend Reverse Exit means
It is an underlying strategy exit, not an option-premium stop.
| Open direction | Completed signal candle | Action |
|---|---|---|
| LONG | Selected NIFTY Spot/FUT SuperTrend changes to RED | Close the STOT option |
| SHORT | Selected NIFTY Spot/FUT SuperTrend changes to GREEN | Close the STOT option |
The configured STOT SuperTrend period, multiplier, signal underlying, and signal candle control this exit. The option risk candle does not.
Live and backtest parity
- Live: protective and active trailing stops use fresh ticks; fixed SL uses option-risk closes; the persistence guard measures continuous live breach time.
- Backtest: uses the smallest configured historical option candle. A fully breached candle supplies deterministic persistence evidence.
- Signal: entry and SuperTrend reversal remain on the strategy signal candle in both engines.
- No look-ahead: only completed candles may confirm a logical stop or strategy reversal.
- Previous Nth close: N=1 uses the latest completed native risk candle. The candidate becomes active after that close, ratchets only toward profit, and is enforced by subsequent ticks or candles.
Execution SOP
| Condition | Required behavior | Audit evidence |
|---|---|---|
| Option quote stale | Do not open a new position. Keep broker-side protection authoritative for live trading and alert the operator. | Workspace, instrument, last quote time, quote age |
| Protective stop hit | Close immediately before evaluating any softer rule. | Order ID, threshold, tick, timestamp |
| Fixed stop breached | Start the continuous timer and count independent risk-candle closes. Exit when either configured rule confirms. | Risk candle ID, close, count, timer |
| Fixed stop recovers | Reset consecutive closes and the continuous timer. | Recovery tick and elapsed breach time |
| SuperTrend reverses | Exit only after the selected underlying signal candle completes. | Underlying, timeframe, color, line, close |
| Service restarts | Restore open legs, stop state, timers, order IDs, tradebook, and workspace ownership before accepting commands. | Recovery event and state version |
System-wide rollout contract
STOT is the first implementation of this model. Every strategy should converge on the same server-owned risk interface:
- Separate signal clocks from risk clocks.
- Define an immediate catastrophe guard and an explicit logical stop.
- Persist stop state per order ID and workspace.
- Use identical decision ordering and audit names in AlgoRun and Backtest.
- Expose only strategy-relevant controls; retain engineering safeguards as validated defaults.