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