Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by zstheorist, Today, 07:52 PM
    0 responses
    7 views
    0 likes
    Last Post zstheorist  
    Started by pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    150 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Started by mattbsea, Today, 05:44 PM
    0 responses
    6 views
    0 likes
    Last Post mattbsea  
    Started by RideMe, 04-07-2024, 04:54 PM
    6 responses
    33 views
    0 likes
    Last Post RideMe
    by RideMe
     
    Started by tkaboris, Today, 05:13 PM
    0 responses
    6 views
    0 likes
    Last Post tkaboris  
    Working...
    X