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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    563 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    329 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    547 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    548 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X