I hope this message finds you well. I am currently developing an add-on for NinjaTrader and am encountering challenges when attempting to close an ATM strategy programmatically.
Specifically, I have the following questions and issues:
- Closing an ATM Strategy Using AtmStrategyClose:
- I found the AtmStrategyClose method in the NinjaTrader documentation, which appears to be the correct method for closing an ATM strategy.
- However, I am unclear about:
- On what object this method should be called.
- How to obtain the required strategyId parameter referenced in the documentation. Could you provide guidance on how to retrieve the strategyId for an ATM strategy that was started programmatically using StartAtmStrategy?
- Using Flatten on the Account:
- I attempted to flatten the account using the Flatten() method, expecting it to close all open orders and positions. While the positions flattened successfully, the ATM orders remained in states such as "Cancel Submitted" or "Initialized", and they were not cleared.
- Could you clarify why this behavior occurs and whether AtmStrategyClose is required to handle ATM-specific orders in such scenarios?
Any insights into how to correctly close an ATM strategy or clear its associated orders programmatically would be greatly appreciated.
Thank you for your time and assistance!
Best regards,
Zadolaya Omani

Comment