I have a strategy which uses ATM strategies for automatic trading. This is to make order execution features like multiple positions with different configurable stops and targets, and manual interventions possible. To improve the tracking (especially for rejected stops), the strategy uses AtmStrategy.StartAtmStrategy(...) instead of the methods documented here:
https://ninjatrader.com/support/helpGuides/nt8/NT%20HelpGuide%20English.html?atm_strategy_methods .htm
To keep track of the order state (knowing when an order was "finished" - filled stops and/or targets, rejection handling, etc.), the strategy uses Account.OnOrderUpdate(...). This works both for sim accounts and NinjaTrader accounts.
But when testing the strategy with an Apex Tradovate account, Account.OnOrderUpdate(...) is only called once (for the state transition to Initialized for the entry order). After that, OnOrderUpdate(...) is never called, even when manually closing the position.
So something seems differently implemented in those "external" accounts / connections. This breaks the strategy - it doesn't know when a position is flat, and the next trade can be executed.
Because the strategy uses ATM orders, the Apex / Rithmic account examples don't apply - they use the simple Enter/Exit-Long/Short(), or SubmitOrderUnmanaged(...). As documented, the Strategy.OnOrderUpdate(...) doesn't work when using ATM strategies, so I'm stuck - I really want to avoid calling GetAtmStrategyEntryOrderStatus() and then GetAtmStrategyStopTargetOrderStatus() on each OnBarUpdate() instead of the event based approach.
Is here an alternate way to keep track of the order state?
Best regards, Felix
Comment