Quick answer
Flatten Everything tells NinjaTrader Desktop to close every open position and cancel every working order across all instruments in all connected accounts. To close just one futures position, right-click its account and contract on the Control Center’s Positions tab and choose Close Position. That command also cancels the working orders for that account and contract.
Choose what you want to close
The Positions tab puts two commands on the same right-click menu. Check the Account and Instrument columns before choosing one. In an order-entry window such as Chart Trader or SuperDOM, the mouse button also determines what Close does.
- One account and contract. Left-click Close in the order-entry window to close the account’s position in the selected contract and cancel its working orders in that contract.
- One active ATM strategy. Select the active ATM strategy, then press the middle mouse button (the scroll wheel) on Close. This targets the position managed by that ATM strategy.
- All connected accounts. Choose Flatten Everything from the right-click menu. It also cancels unfilled entry orders, including orders for contracts where the account is already flat.
- One unfilled order. Cancel that order if you want to withdraw it. A cancellation leaves any quantity that has already filled in the account position.
What happens with two connected accounts?
Suppose Account A is long one ES contract with a working stop. Account B holds an NQ position and also has an unfilled ES entry order. Choosing Close Position on Account A’s ES row requests cancellation of its stop and closes its ES position. Account B keeps both its NQ position and its ES entry order.
Choose Flatten Everything in the same example and the command covers both open positions, Account A’s stop and Account B’s resting entry. Filtering the Positions tab to show only Account A changes what you see. Account B is still connected and remains within the scope of Flatten Everything.
When does NinjaTrader ask for confirmation?
Desktop 8.1.9 added the trading setting “Confirm close and order cancellation.” It starts turned off. To enable it, open the Control Center, choose Tools, then Settings, then Trading.
With the setting enabled, a manual Close or an individual order cancellation prompts you to confirm. Flatten Everything, Cancel All and automatic cancellations fall outside that setting.
Check both Positions and Orders after a close
For a futures position, NinjaTrader requests cancellation of working orders and waits up to five seconds for the brokerage to acknowledge them. Once all cancellations are confirmed, it sends an offsetting order for the open position. A timeout leaves the outcome uncertain.
An order can fill while a cancellation is in flight. For example, a sell target can fill just as a long position is being closed. If a closing sell also fills, the account can end up short. In the Control Center, check Positions for the resulting account quantity and Orders for anything still working. If a live account’s status is unclear, verify it with the broker’s trade desk before submitting another order.
Official sources
Platform monitoring
Get an email if NinjaTrader goes offline
Ninja Watchdog monitors the Windows desktop or VPS running NinjaTrader and can alert you to a platform interruption.
