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 f.saeidi, Today, 12:14 PM
    7 responses
    16 views
    0 likes
    Last Post f.saeidi  
    Started by Russ Moreland, Today, 12:54 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by philmg, Today, 12:55 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Started by TradeForge, 04-19-2024, 02:09 AM
    2 responses
    32 views
    0 likes
    Last Post TradeForge  
    Started by aprilfool, 12-03-2022, 03:01 PM
    3 responses
    329 views
    0 likes
    Last Post NinjaTrader_Adrian  
    Working...
    X