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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        80 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        40 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        63 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        63 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        54 views
        0 likes
        Last Post CarlTrading  
        Working...
        X