I have Interactivebrokers live brokerage connected to ninjatrader.
If I want to close positions using limit order at ask price for long position, I would imagine that I need the bid/ask price of the instruments.
Sometimes, for large portfolio, we cannot enter each instruments into the instrument manager all the time... is there any way to do this or we don't even need to know the bid/ask prices?
For example:
for (int i=0;i<=NinjaTrader.Cbi.Globals.Accounts.Count-1;i++)
{
if (NinjaTrader.Cbi.Globals.Accounts[i].Name == accName)
{
a = NinjaTrader.Cbi.Globals.Accounts[i];
}
}
if (a != null)
{
Order o = a.CreateOrder(........) // how to implement this?
o.Submit();
}
Comment