Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Scope of Custom Performance Metric and Custom OptimizationFitness

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

    Scope of Custom Performance Metric and Custom OptimizationFitness

    Hello,

    I've been reading about Custom Performance Metrics and Custom OptimizationFitness and was hoping to understand them better. Specifically, what are the limits to using each of them (ie what they can and cannot do)? My question is intended to be a higher level summary, since I understand to a certain extent the possibilities are limited only by imagination. To clarify what I mean, I'll explain what I know so far at a high level.

    Custom Performance Metrics
    • Designed to track custom metrics BASED ON EACH TRADE and can either be shown on a per trade basis, a summary basis, or both.
    • They need to be calculated using available values from the Trade object (MaeCurrency, ProfitCurrency, etc)
    Custom OptimizationFitness
    • Designed to find the best parameter set combination during Optimization. The definition of the best parameter set is the one with the largest value in the Value variable.
    • They need to be calculated using available values from the Strategy object. This can mean using SystemPerformance, TradeCollection or any other property.
    • Because we're accessing the strategy instance, this can also mean we can access publicly accessible custom properties, such as custom List<double> variables or anything else for that matter
    Are there any other considerations for these two? Are there more benefits/limitations to them that are significant?

    To help frame my overall question even better, I'd like to take an example of a custom metric that I'd like to implement. This metric is from Schwager on Futures: Technical Analysis and is called the Return Retracement Ratio (page 713). This metric takes a certain interval, in this case we'll use a Monthly interval. So in this example, for each Month, we would need to keep track of a few monthly variables as well as a few global variables (for min and max). All of these things could be measured at month-end (eg on the last day of the month):
    • Current month equity
    • MAX equity at any given data point (month-end)
    • MIN equity at any given data point (month-end)
    • Difference between MAX equity at any point and Current month equity
    • Difference between Current month equity and MIN equity at any point
    As you can see, all of these stats apply to Month End rather than to any specific trade. For example, we could have a long-term trend following strategy that is in a trade for 2 or 3 years. In this case, we would still want to keep track of Month End data points for the values above.

    My understanding is this: Since Custom Performance Metrics are based on individual Trade stats, I cannot use this for this solution. Since Custom OptimizationFitness uses the Strategy, I could use custom variables in my strategy that keeps track of these metrics by checking if the current Daily bar is the last bar of the month and doing my calculations. I could then access those public custom variables in my Custom OptimizationFitness and calculate the RRR from these to get the best result based on RRR. However, with this approach, how do I actually see the value of the RRR within the Strategy Analyzer for each Optimization iteration?

    I hope I did a good enough job of explaining this. Really I'm looking for two things:
    • Get a better overall understanding of Custom Performance Metrics and Custom OptimizationFitness and hopefully get a thorough explanation for others who are looking for the same on these forums.
    • Figure out a solution to my RRR calculation and other similar calculations in the future.
    Thank you very much for the time!
    Paul

    #2
    Hello Paul,

    Thank you for your post.

    It seems that you understand Custom Performance Metrics and Custom OptimizationFitness correctly. Performance Metrics measure what happens with each trade. Optimization metrics typically look at the performance of the strategy by referencing strategy.SystemPerformance followed by using those metrics in a useful way and assigning them to Value. The strategy instance with the highest Value gets the highest rating.

    Here are some help guide documentation for more information.
    Performance Metrics - https://ninjatrader.com/support/help...ce_metrics.htm
    Custom Optimizer - https://ninjatrader.com/support/help.../optimizer.htm

    As for 'RRR', you could take whatever value is calculated for RRR and put it in a public variable in your strategy as you mention in your post. You could assign the RRR value directly to Value to see it in the Strategy Analyzer.

    Please let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hi Brandon,

      Thanks a lot for your response. Just one question on your comment:

      As for 'RRR', you could take whatever value is calculated for RRR and put it in a public variable in your strategy as you mention in your post. You could assign the RRR value directly to Value to see it in the Strategy Analyzer.
      I understand the part about assigning RRR to Value directly, but I don't know where to see that in the Strategy Analyzer. Since that is an Optimization Fitness, do I have to enable that similarly to Custom Performance Metrics in order to see it somewhere? Are you able to show a screenshot or something of where I should be seeing the Value of the Custom Optimization Fitness? Thank you!

      Comment


        #4
        Never mind Brandon, I figured it out. I ran an optimization on Sharpe Ratio and was looking around for all the places I could find that. Then I saw the Performance column, which is the first column in the Strategy Analyzer results. I see the Optimization Fitness selection that I make shows up in the Performance column. Screenshot below for those who are new to that like I was. Thanks!

        Click image for larger version

Name:	Screenshot 2020-11-28 102736.png
Views:	30
Size:	14.2 KB
ID:	1129818

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by dtmtradingco, Today, 12:30 PM
        1 response
        9 views
        0 likes
        Last Post soon123
        by soon123
         
        Started by POTTER16, Today, 03:31 PM
        0 responses
        8 views
        0 likes
        Last Post POTTER16  
        Started by enricbcn, 05-08-2018, 01:36 AM
        78 responses
        43,521 views
        1 like
        Last Post Wessel
        by Wessel
         
        Started by Wessel, Today, 12:50 PM
        0 responses
        8 views
        0 likes
        Last Post Wessel
        by Wessel
         
        Started by asmmbillah, Today, 12:39 PM
        0 responses
        9 views
        0 likes
        Last Post asmmbillah  
        Working...
        X