In the indicator I'm checking for an open position with the account.Positions collection.
The manual mentions a Positions as well as a PositionsAccount collection, and makes some confusing remarks about the difference.
https://ninjatrader.com/support/help...ionaccount.htm
Holds an array of Position objects that represent positions managed by the strategy.
This property should only be used when your strategy is executing orders against multiple instruments.
https://ninjatrader.com/support/help...onsaccount.htm
This property should only be used when your strategy is executing orders against multiple instruments.
And in the Position help it says:
https://ninjatrader.com/support/help.../?position.htm
Represents position related information that pertains to an instance of a strategy.
Tips: •For multi-instrument scripts, please see Positions object which holds an array of all instrument positions managed by the strategy's account •For a real-world Account Position, please see PositionAccount. |
https://ninjatrader.com/support/help...ionaccount.htm
Represents position related information that pertains to real-world account (live or simulation).
Tips: •For multi-instrument scripts, please see PositionsAccount object which holds an array of all instrument positions managed by the strategy's account •For a Strategy Position, please see Position |
Which of these collections should I use for live trading?
Comment