Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Open Orders

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

    Open Orders

    Hi

    How can I get all the non-filled orders (and their IOrder) which already exist on my account?

    Thanks

    #2
    Hello,

    Thank you for the question.

    For checking All non filled orders, there is not really a collection of these items. What you could do is to check in the OnOrderUpdate or OnExection for orders that come through with a status of not filled. This would provide the IOrder for that specific order.

    There is a simple example of this checking for filled orders which could be reversed to check for anything but filled orders located here: http://www.ninjatrader.com/support/h...ub=onExecution

    I look forward to being of further assistance.

    Comment


      #3
      Is there a way to recognize orders and positions which were created outside of my strategy?

      Thanks

      Comment


        #4
        Hello kiss987,

        Thanks for your post.

        There is no supported method to accomplish this.

        Here is an unsupported method that you can use at your own risk:

        Code:
        foreach (Account acct in Cbi.Globals.Accounts)
        {
        if (acct.Positions != null)
        {
        PositionCollection positions = acct.Positions;
        foreach (Position pos in positions)
        {
        Print(pos.Account.Name + " " + pos.Instrument + " " + pos.MarketPosition + " " + pos.Quantity + " " + pos.AvgPrice);
        }
        }
        Also, this post may provide further info: http://ninjatrader.com/support/forum...ad.php?t=68029

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        55 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        142 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        160 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        96 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        276 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X