Copilink Desktop App coming soon.
Guide
kill switch
flatten all
NinjaTrader
automation
prop firm
emergency
risk management
multi-account

How to Automate a Kill Switch That Flattens All Prop Firm Accounts Simultaneously

One button. Every account flat. In under 2 seconds. If you're running 15 funded accounts and something goes wrong — system failure, news shock, emergency — this is the single most important safeguard you can build. Here's how.

Copilink Team
March 1, 2026
5 min read
90 views

How to Automate a Kill Switch That Flattens All Prop Firm Accounts Simultaneously

The kill switch is the emergency brake. You hope you never need it. You build it first.

At 10 funded accounts, an emergency that requires manual flattening — clicking through each account individually, submitting market orders one at a time — takes 3-5 minutes. In a fast-moving market, 3 minutes of unmanaged exposure across 10 accounts during an emergency is the kind of thing that ends a trading operation. The kill switch gets you flat in under 5 seconds, automatically, regardless of what else is happening.


What "Kill Switch" Actually Means

For the purposes of prop firm multi-account management, a kill switch is a mechanism that:

  1. Flattens all open positions across all connected accounts simultaneously — not sequentially, not one by one, but parallel execution
  2. Cancels all working orders (stops, targets, open entries) on all accounts
  3. Prevents new orders from being entered until the switch is disengaged
  4. Optionally triggers alerts (notification, email) to confirm the trigger fired

The first two requirements are the emergency response. The third is behavioral safety — you don't want to trigger the kill switch and then accidentally enter a new position 30 seconds later during a chaotic session. The fourth is operational confirmation that the trigger actually fired as intended.


Method 1: Copilink Portfolio-Level Kill Switch

Copilink's portfolio kill switch is the cleanest implementation for multi-account setups already using the copier. The kill switch is accessible through the Copilink interface as a dedicated button — clicking it sends parallel flatten commands to all connected follower accounts simultaneously.

The parallel execution is key. Rather than iterating through accounts sequentially (flatten account 1, wait for confirmation, flatten account 2...), Copilink sends the flatten instruction to all accounts at the same moment. At local execution speeds, all accounts begin their market exits within milliseconds of each other.

Configuration: the kill switch function is built-in — no additional setup required beyond having the copier running. Familiarize yourself with its location in the UI before a session, not during one. The muscle memory of where the button is matters when you need it.


Method 2: NinjaScript Keyboard Shortcut Kill Switch

For traders who want a system-level kill switch that operates independently of the copier interface, a NinjaScript-based solution provides an alternative. The logic:

// Global NinjaScript add-on that monitors for a keyboard shortcut
// When Ctrl+Shift+K is pressed:
// 1. Iterate all connected accounts
// 2. For each account with open positions, submit market orders to flatten
// 3. Cancel all working orders on each account
// 4. Log the kill switch trigger with timestamp

protected override void OnKeyDown(KeyEventArgs e)
{
    if (e.Control && e.Shift && e.KeyCode == Keys.K)
    {
        foreach (Account account in Account.All)
        {
            account.Flatten();
            account.Cancel(account.Orders.ToList());
        }
        Print("KILL SWITCH TRIGGERED: " + DateTime.Now.ToString());
    }
}

This is pseudocode illustrating the concept — the actual NinjaScript implementation requires the full add-on framework, proper threading to avoid UI blocking, and error handling for accounts that don't respond. The NinjaTrader developer documentation has the Account class reference for the actual API calls.

The keyboard shortcut approach gives you a physical trigger you can hit from anywhere in NinjaTrader without navigating to a specific UI element — helpful when the session is chaotic and you need the fastest possible response time.


Method 3: Automatic Trigger on Portfolio P&L Threshold

Beyond the manual emergency trigger, an automatic portfolio-level kill switch fires without human action when a defined portfolio loss threshold is reached. This is the protection for scenarios where you're not watching the screen — a position running against you while you're away from the computer, or a connection issue that prevents manual intervention.

Configuration in Copilink: set a portfolio-level maximum loss threshold. When aggregate P&L across all follower accounts (unrealized + realized) exceeds this threshold in the loss direction, the kill switch fires automatically. All positions flatten. New entries are blocked until manual reset.

The threshold should be set at the portfolio level at approximately 60-70% of combined daily loss limits across all accounts. If 10 accounts have $750 internal daily limits each, the portfolio threshold is 10 × $750 × 65% ≈ $4,875. When portfolio losses hit that level, something is genuinely wrong — markets are moving against the strategy across all accounts simultaneously, which suggests either an extraordinary market event or a strategy failure mode that warrants stopping rather than continuing.


Testing the Kill Switch (Non-Negotiable)

A kill switch that hasn't been tested is a kill switch that might not work when you need it. Testing procedure:

  1. In simulated/paper trading mode, open positions on multiple accounts
  2. Trigger the kill switch using whichever method you're implementing
  3. Verify all positions close — every account, not just some
  4. Verify the time from trigger to flat is under 5 seconds
  5. Verify working orders (stops, targets) are cancelled, not just positions
  6. Verify new orders are blocked after the trigger fires

Run this test every time you update the copier, update NinjaTrader, or change the account configuration. Five minutes of testing before deploying changes beats discovering a broken kill switch during an emergency. The test isn't paranoia — it's operational competence.

Ready to Start Trade Copying?

Try Copilink free for 7 days. No credit card required. Copy trades across unlimited prop firm accounts.