On the StartAtmStrategy path the help guide gives you no ATM id and no documented way from an ATM back to its orders. Taking your five questions in turn:
1. An instance id from StartAtmStrategy. None documented. The StartAtmStrategy page lists two overloads (a template object or a template name, plus the entry Order) and documents no return value, no id and no callback. What you hold is the entry Order you created and passed in. Recognise it with e.Order == entry: the Order page says you can compare Order objects directly, and that OrderId “is NOT a unique value, since it can change throughout an order’s lifetime”. No page promises the ATM submits that same object, so print the comparison once on your build.
2. A supported call for the instance’s child orders. No. The AtmStrategy class page has no member list, and nothing documented on Order points to its ATM. The children arrive on Account.OrderUpdate named Stop1, Target1, Stop2 and Target2, and every ATM from the same template uses those names, so the name alone cannot separate two ATMs. GetAtmStrategyStopTargetOrderStatus and AtmStrategyChangeStopTarget are NinjaScript Strategy methods keyed on the atmStrategyId that strategy passed to AtmStrategyCreate, so an indicator has neither the methods nor the id.
3. What does link them. Only something undocumented: Order has a GetOwnerStrategy() method that returns the owning strategy object, which for an ATM order is the AtmStrategy instance, with a numeric Id. Same owner as your entry, same ATM. One developer on this forum has posted it (a search for GetOwnerStrategy finds the threads), and NinjaTrader has not documented it, so re-check it on each release. On OCO: Stop1 and Target1 should share one e.Order.Oco string and Stop2 and Target2 another, but the guide documents neither the pairing nor uniqueness across ATMs, so treat it as a hint until you have printed it.
4. Several ATMs on one instrument and account. The documented answer is a NinjaScript Strategy. Start each ATM with AtmStrategyCreate and two ids from GetAtmStrategyUniqueId (one for the entry, one for the ATM), map your operation id to the ATM id, read GetAtmStrategyStopTargetOrderStatus("Target1", atmId) and the same for Stop1, then call AtmStrategyChangeStopTarget(0, price, "Stop2", atmId). Each id is one ATM, so they stay apart; it runs in real time only (ATM Strategy Methods). The other documented route keeps the indicator and drops the ATM: on the entry fill, submit Target1 and Stop1 under one OCO string and Target2 and Stop2 under another, both built from your operation id, and the mapping is yours by construction, at the cost of the template’s own features. If you keep StartAtmStrategy, filter by instrument, then by the entry’s owner, then by Name. One limit, from the same developer: entries started while Chart Trader’s ATM selector showed a running instance landed under that instance’s Id with separate brackets, and a Chart Trader Buy Market merges into whichever ATM the selector shows. So use a template nobody trades from Chart Trader, and if two of your entries can overlap, print both Ids before trusting the owner to tell them apart.
5. Across the lifecycle.
- Partial fills. The GetAtmStrategyStopTargetOrderStatus page notes that entry partial fills a few seconds apart get a stop and a target each, under the same name, so keep a list per name: “Stop2” can be two orders.
- State changes. Read
e.OrderState from the event; the Order object reflects the current state and can already be ahead of it.
- The modification. Set
StopPriceChanged, not StopPrice, and call Account.Change, as the Change page example does; a user here who wrote StopPrice saw the change silently dropped. The confirmation is a later OrderUpdate with Stop2 back in Accepted or Working at the new price, not Change returning. Changing an ATM-owned stop this way is not documented, though users here report it works. Turn off auto breakeven, auto trail and any stop strategy in that template, or the ATM can move Stop2 again after you.
- Reloads. Reload NinjaScript gives you a fresh indicator instance with empty fields while the ATM keeps running, so keep the owner’s Id outside the instance if you need to pick a running trade back up.
- Threads. Assume the Account.OrderUpdate handler runs off your chart’s thread, and lock what you share.
If it helps, I can post a small test indicator that starts one ATM and prints every order on the instrument with its owner Id, name, state and OCO string, which shows all of the above on your build in a few minutes.