I am trying to prevent my automated strategies to place orders when initial margin requirements are not met.
I am using NinjaTrader Brokerage and Continuum.
When I use GetAccountValue(AccountItem.CashValue), it does not take into account the margin that is used by the currently open positions.
Since GetAccountValue(AccountItem.BuyingPower) returns always 0 (not supported), I don't find a way to achieve this.
Does anyone know how this can be solved ?
Comment