Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy integration with subdivision of Performance Metrics

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

    Strategy integration with subdivision of Performance Metrics

    Hello,

    I was told by a moderator to integrate 2 competing Strategies into one. The moderator told me this because I wanted to use Performance metrics of one strategy to be utilized by another strategy.
    NOTE: these 2 strategies have different Risk thresholds (Profit Target / Stop Loss)
    When I try to put these 2 strategies together it has lead to me having to choose the larger of the 2 risk thresholds to be applied to both strategies.
    AND
    The performance metrics for both Strategies have combined into one set of performance metrics.
    This has rendered the logic I wanted to cross reference AND the risk thresholds to become combined and now both strategies function with a lower level of utility than if I was to leave them separate.

    Question 1: what do I need to account for when merging strategies to keep Risk thresholds in line with the strategy they are associated with?
    Question 2: how do I keep Performance metrics in line with the strategy they are associated with?

    #2
    Hello GTBrooks,

    With the Stops and Targets you can use unique signal names and from entry signals and have the stops and targets be separate for the entries from each set of logic.

    With the trade collection / performance metrics, this would include all trades made by the strategy from either logic set.
    It might be possible to sort these into new separate trade collections using undocumented code.
    In OnPositionUpdate when the SystemPerformance collection updates, you can check the last trade entry name and use logic to add the trade to a new trade collection.
    This forum post from a community member provides some sample code of making a new trade collection.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Is there any method to do a comparison between Strategies trading the same Instrument that a Strategy can use to see where it sits in comparison with others. So far I have had to do this manually after each trade is completed.

      Comment


        #4
        Hello GTBrooks,

        You could open the Strategy Performance window from each strategy and compare these.


        Or you could write the performance information from the strategies to a text file.
        Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.

        Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.

        Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.

        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thank you,

          the writing to TXT Doc will help immensely.

          clearification needed: Could this write to an open Excel file that is set to auto calculate?

          Comment


            #6
            Hello GTBrooks,

            You can write a .cvs file and open this in Excel. I don't know if excel is able to detect changes to a file while it is open.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Perfect,
              this will help me automate comparative studies Indo manually currently.
              the rest I will have to workout with Microsoft.

              thank you for your help 5/5 Stars

              Comment


                #8
                I think I figured out a way to do it if a Strategy could separate the performance metrics under signal name.
                if I ca call signal name, I can use my priority magnitude quantity size calculation. Is there a way to call all long or short historical and real-time performance metrics by signal name?

                Comment


                  #9
                  Hello GTBrooks,

                  You could loop through the SystemPerformance.AllTrades collection and use a branching command (if-statement) to filter out by the entry signal name.
                  Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.

                  Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.


                  foreach (Trade thisTrade in SystemPerformance.AllTrades.ToList())
                  {
                  if (thisTrade.Entry.Name == "MySignalName")
                  {
                  // do something with this trade
                  }
                  }
                  Chelsea B.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by NullPointStrategies, Yesterday, 05:17 AM
                  0 responses
                  59 views
                  0 likes
                  Last Post NullPointStrategies  
                  Started by argusthome, 03-08-2026, 10:06 AM
                  0 responses
                  134 views
                  0 likes
                  Last Post argusthome  
                  Started by NabilKhattabi, 03-06-2026, 11:18 AM
                  0 responses
                  75 views
                  0 likes
                  Last Post NabilKhattabi  
                  Started by Deep42, 03-06-2026, 12:28 AM
                  0 responses
                  45 views
                  0 likes
                  Last Post Deep42
                  by Deep42
                   
                  Started by TheRealMorford, 03-05-2026, 06:15 PM
                  0 responses
                  50 views
                  0 likes
                  Last Post TheRealMorford  
                  Working...
                  X