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)
- 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
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
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.
Paul
Comment