Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Closing positions using limit order

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Closing positions using limit order

    Hi,

    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();

    }

    #2
    Hello,

    Thank you for the question.

    For this item, I would unfortunately not have a suggestion as this is not a documented item so I could not provide any relevant information on this. It would not be suggested to submit orders outside of the documented approaches as there would be no way to determine if something is going wrong as there is no expectations related to that syntax.

    This thread will remain open in the case any other users have come across this before or used this specific syntax for the given purpose.

    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    51 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    30 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    99 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    177 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    170 views
    0 likes
    Last Post CarlTrading  
    Working...
    X