Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnExecutionUpdate => get value from "averageFillPrice"

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

    OnExecutionUpdate => get value from "averageFillPrice"

    hello everyone,
    how can I access the value "averageFillPrice"?​

    I have:
    Code:
    protected override void OnExecutionUpdate (Execution execution, string executionId, double price, int quantity, MarketPosition marketPosition, string orderId, DateTime time)
            {
                // This is the code I used to discover the Stop loss order's name
                Print("OOU: order: " + execution.Order);
    
                // Now that I know it is 'Stop loss', I can use this name here
                if (execution.Order.Name == "Stop loss")
                {
                    PriceOut = execution.Order.averageFillPrice; // 21599.25 ????
                    .............​
                }
            }
    In the executen.Order is:
    OOU: order: orderId='14e2913fdc174113a2996443a4dbeff3' account='Playback101' name='Stop loss' orderState=Filled instrument='NQ 03-25' orderAction=BuyToCover orderType='Stop Markt' limitPrice=0 stopPrice=21599.25 quantity=1 tif=Gtc oco='a8777b145c3e418eb0c88011d11e832b' filled=1 averageFillPrice=21599.25 onBehalfOf='' id=15615 time='2024-12-19 16:21:55' gtd='2099-12-01' statementDate='2024-12-19'
    Can someone please help me here
    Falke07

    #2
    Hello Falke07,

    Thank you for your post.

    Execution objects do not have an AverageFillPrice property.

    You can execution.Price to get the price the order filled at.

    Comment


      #3
      Hello Gaby,

      thank you ;-)

      Falke07

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      45 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      21 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      31 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X