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, 03-31-2026, 09:41 PM
      1 response
      43 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
      30 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
      41 views
      0 likes
      Last Post CarlTrading  
      Working...
      X