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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        57 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        78 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        39 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        101 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        61 views
        0 likes
        Last Post PaulMohn  
        Working...
        X