Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SystemPerformance return null in realtime

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

    SystemPerformance return null in realtime

    Hi,

    I am trying to retrieve some SystemPerformance info of the current trade which was just completed (OnOrderUpdate trigger orderState==OrderState.Cancelled for either the Stop or Target order).

    When running in Strategy Analyzer, I get SystemPerformance.AllTrades.GetTrades(owner. Instrument.FullName, fromSignalName, 1) to return the relevant trade, but when running the strategy from the chart it returns null.

    Any ideas?

    #2
    Hello Shai Samuel,

    You would need to find a filled exit order that completes a trade, watching for a cancelled order from OnOrderUpdate would not be the correct approach. You can use OnExecutionUpdate to find when a exit order fully fills and then look for the trade which would at that point be complete and paired with its entry.

    Comment


      #3
      Be sure you set this property to true (the default) if it is not already if you are going to use these features https://ninjatrader.com/support/help...inbacktest.htm

      Also, check if SystemPerformance.AllTrades is null before you try to call GetTrades on that.
      Bruce DeVault
      QuantKey Trading Vendor Services
      NinjaTrader Ecosystem Vendor - QuantKey

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      476 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      317 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      254 views
      1 like
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      340 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      306 views
      0 likes
      Last Post CarlTrading  
      Working...
      X