Strategy Kill Switch

Automatically exit all trades in a strategy when aggregate profit or loss crosses a threshold.

Kill Switch monitors the combined unrealized P&L of every active trade in a strategy and automatically exits all of them when aggregate P&L crosses a threshold you configure. No manual intervention — it runs on every Trade Manager decision cycle.

ℹ️

Kill Switch is a Pro feature. It requires Trade Manager (TM) to be active. Free-tier accounts running BYOS execution only do not have Kill Switch available.

What it does

Two triggers are available per strategy:

TriggerConfig fieldFires whenAction
Profit lockpullplug_profitAggregate open P&L ≥ thresholdExits all open trades in the strategy
Loss limitmax_lossAggregate open P&L ≤ −thresholdExits all open trades in the strategy

Both triggers evaluate aggregate unrealized P&L across all active trades in the strategy, across all accounts, on every TM cycle. Either trigger can be set independently — you do not need both.

Why use it

Lock in a winning session

A strategy can run three solid trades in the morning and then give it all back in the afternoon. With pullplug_profit set, Execute exits everything as soon as aggregate gains cross your target — the session ends profitable, no giveback.

Cap a losing run

When a strategy starts misfiring — multiple losing trades in the same session — losses compound faster than any single-trade SL can contain. max_loss exits every open trade the moment aggregate drawdown hits your limit. You stop the session, review what happened, and redeploy on your terms.

Both triggers work together. Set both and whichever trips first exits the strategy.

Configuration

Kill Switch is configured in the Killswitch tab of your Google Sheet (exact tab name required). The format is a transposed table: one column per strategy, one row per parameter.

Example:

Parameter          | sst      | cst       | gss
pullplug_profit    | 50000    | 30000     | (blank)
max_loss           | 15000    | 10000     | 8000
mode_profit        | full_exit| full_exit | (blank)
mode_loss          | full_exit| full_exit | full_exit

Parameter reference:

FieldTypeDescription
pullplug_profitNumberProfit threshold. Exits when aggregate P&L ≥ this value. Leave blank to disable.
max_lossNumberMaximum loss (enter as a positive number). Exits when aggregate P&L ≤ −this value. Leave blank to disable.
mode_profitStringExit mode when profit trigger fires. Only full_exit is supported.
mode_lossStringExit mode when loss trigger fires. Only full_exit is supported.

Threshold values are in the local currency of your accounts (INR for Zerodha, USD for IBKR).

⚠️

Mixed-currency accounts: P&L from all accounts in a strategy is summed numerically without currency conversion. If you run the same strategy on both a Zerodha (INR) and IBKR (USD) account, their P&Ls are added together directly. Set Kill Switch thresholds only when all accounts for a strategy use the same currency.

How P&L is calculated

Aggregate P&L is computed on every TM decision cycle from:

  1. Each trade's entry price (as recorded at entry)
  2. The current live price from your broker for the exact instrument and quantity
  3. Summed across all active accounts for the strategy

P&L is unrealized — it reflects open positions, not closed trades. Kill Switch does not factor in exits that already closed during the same session.

Safeguards

  • Excludes exiting trades. Trades already in PENDING_EXIT or RETRY_EXIT state are excluded from the P&L calculation — they are already exiting.
  • Requires complete price data. If any account's live price fetch fails, Kill Switch skips evaluation for that cycle rather than triggering on incomplete data.
  • Multi-leg options excluded. Coordinated multi-leg option positions (e.g., iron condors across accounts) are excluded from Kill Switch evaluation. You receive a Telegram alert if this applies. Close multi-leg positions manually through your broker.

What happens when it triggers

  1. Execute marks every active trade in the strategy as PENDING_EXIT.
  2. Exit orders are placed on every account immediately — same mechanism as a normal SL-triggered exit.
  3. A Telegram alert is sent with the strategy name, trigger type (profit lock or loss limit), and aggregate P&L at the time of trigger.
ℹ️

Telegram alerts require Telegram to be configured in your account hub. If Telegram is not set up, the exits still fire — but you receive no notification.

How to disable

To disable a trigger, clear (blank) the corresponding threshold cell in your Killswitch tab. The change takes effect on the next TM cycle — no redeploy required, subject to the sheet config cache (up to 55 minutes).

To disable Kill Switch entirely for a strategy, blank all four fields in that strategy's column.

Next steps

  • Risk sizing — per-strategy and per-account position sizing configuration
  • Trade Manager — how individual exit management works alongside Kill Switch
  • Google Sheet configuration — AccountConfig and Killswitch tab reference