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 NullPointStrategies, Today, 05:17 AM
      0 responses
      38 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      124 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      64 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      41 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X