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 CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      61 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      34 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      198 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      364 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      283 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X