Quick answer
An ATM strategy manages stop-loss and profit-target orders around an entry; its saved template is not an entry-signal program. A NinjaScript strategy can evaluate conditions and submit entries and exits. A script can also launch an ATM, but the ATM's executions then belong to a separate management path and do not update the hosting script's position or performance.
What each type of strategy controls
A strategy built with NinjaTrader's Strategy Builder is still a NinjaScript strategy. Its Conditions and Actions can submit entry and exit orders. The word strategy on two screens does not mean the settings or order ownership are interchangeable.
| Question | ATM strategy | NinjaScript strategy using its own orders |
|---|---|---|
| What decides when to enter? | The trader or another entry mechanism supplies the entry. | The programmed conditions can trigger entries. |
| What manages the exit? | The configured ATM stop-loss, target and stop-management rules. | The script's entry/exit and order-management logic. |
| What does a saved template contain? | Reusable ATM order-management settings. | Strategy parameters; the underlying script defines the behavior. |
A template and an active ATM are different selections
In an order-entry window, selecting a saved template starts an ATM when the entry fills or partially fills. Selecting an active ATM instance instead adds the fill to that instance and adjusts its associated stops and targets.
The selection mode matters for the next entry. Select Active ATM Strategy on Order Submission keeps the running instance selected, supporting scaling into it. Keep Selected ATM Strategy Template on Order Submission keeps the template selected, creating a new set of brackets for each entry. Selecting None does not attach ATM stops or targets.
When a NinjaScript strategy launches an ATM
AtmStrategyCreate() submits an entry order using a named ATM template. Creation is asynchronous. Its callback reports whether the ATM started; that callback alone is not confirmation that the entry filled.
After this handoff, ATM executions do not update the hosting NinjaScript strategy's position, PnL or performance tracking. EntriesPerDirection, EntryHandling and IsExitOnSessionCloseStrategy also do not apply to the AtmStrategyCreate() call. Use the ATM-specific order and position methods with the correct identifiers instead of assuming the script's ordinary state describes the trade.
One subtle example: GetAtmStrategyMarketPosition() can return Flat when the specified ATM does not exist. After a fill, its position change is not reflected until at least the next OnBarUpdate(). A Flat reading by itself therefore cannot establish that the account has no exposure.
Keep historical tests and restart behavior separate
NinjaTrader documents ATM execution as real-time only: AtmStrategyCreate() does not run on historical data and is not backtestable. A Strategy Analyzer result therefore cannot validate that ATM execution path. NinjaTrader includes SampleATMStrategy as a coding reference; it is not evidence that a custom script has been tested.
Use the Playback and Sim101 guide to choose a simulation setup, then examine the actual entry, ATM instance and exit behavior your script produces. After a restart, account synchronization and strategy startup settings are a separate question; the Start Behavior guide explains those states without treating an account position as proof of order ownership.
Official sources
Protect your setup
Keep NinjaTrader recovery automatic
Monitor NinjaTrader, recover supported interruptions, and receive recovery alerts on your Windows computer or VPS.
