Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get filled quantity of a partially filled order inside OnBarUpdate

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

    Get filled quantity of a partially filled order inside OnBarUpdate

    Hello,

    I am submitting an order inside an indicator that is attached to Market Analyzer (add-on) as below.

    Code:
    order1 = myAccount.CreateOrder(myInstrument, OrderAction.Buy, OrderType.Limit, TimeInForce.Day, 1, GetCurrentBid(0), 0, null, "Entry", null);
    myAccount.Submit(new[] { order1 });

    How can I get the execution quantity in case of a partially filled order? Can I do this without using OnExecutionUpdate?

    ​Thank you,

    #2
    Hello MSerag,

    Thank you for your post.

    The best way to do this to ensure you are getting the most timely and accurate information would be to subscribe to ExecutionUpdate events for your account. This may still be done using the Account class in an add-on style approach, as demonstrated on the following page:
    You may also subscribe to OrderUpdate events and PositionUpdate events if you'd like:Please let us know if we may be of further assistance.

    Comment


      #3
      Thanks for your help.
      Can I store the below in the class variables rather than printing them?

      Code:
      // Output the new position
      NinjaTrader.Code.Output.Process(string.Format("Ins trument: {0} MarketPosition: {1} AveragePrice: {2} Quantity: {3}",
      e.Position.Instrument.FullName, e.MarketPosition, e.AveragePrice, e.Quantity), PrintTo.OutputTab1);
      Thanks again.​

      Comment


        #4
        Of course, if you wish.
        Bruce DeVault
        QuantKey Trading Vendor Services
        NinjaTrader Ecosystem Vendor - QuantKey

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        646 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        367 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        107 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        569 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X