- ago
I've created a Custom Score Card and and populated the Report with all Basic & Extended ScoreCard Metrics plus a few of my own. The values for the Basic & Extended ScoreCards display correctly but the Tips do not.

Note: The tips for my custom metrics show correctly.

I am referencing the bt.metric.name in the LayoutMetricsReport like so:

CODE:
reportHost.AddMetricDouble("StandardDeviationOfProfits", True, False, 2, "Standard Deviation Of Profits") // Where StandardDeviationOfProfits is a prepopulated ExtendedScoreCard metric bt.Metrics.StandardDeviationOfProfits

MetricName, MetricValue, MetricTip, MetricValueDirection, MetricOptimizable are all set in the Extended ScoreCard. Therefore I have not added code to alter these in my ScoreCard. The only code added to my custom card is in the LayoutMetricsReport for inclusion on my report.

Is this result by design, or is it a bug?
0
597
Solved
10 Replies

Reply

Bookmark

Sort
- ago
#1
Reference Images

Extended ScoreCard showing populated Tip



Custom ScoreCard showing Empty Tip (with sourcecode Reference.)

0
Glitch8
 ( 9.28% )
- ago
#2
Thanks, we will get these tips working across ScoreCards!
2
- ago
#3
That would be great, thank you :-)
0
Glitch8
 ( 9.28% )
- ago
#4
Look for the change when Build 28 is released.
1
Best Answer
- ago
#5
Hi Splodge,
I am curious: How did you leverage existing metrics in your own custom scorecard?
Calculate yourself? Call the original Scorecard?
0
- ago
#6
Thanks Glitch - Will do!

Hi Dr Koch,

There's no need to recreate the metrics.

All scorecards metrics are calculated held in the bt.metrics object at the end of a backtest run which is exposed to custom cards for adding new metrics.

The Names of the Metrics from each scorecard can be found in the Preferences -> Metric Columns Tab of the WL7 GUI.

Just add the reporthost line for the metric you want to display in your LayoutMetricsReport Override Sub. (Reference image below)

Note: MetricNames are case sensitive.

I've recreated the Basic and Advanced Scorecards (vb.net code below reference image)



CODE:
'VB.NET Code Public Overrides Sub LayoutMetricsReport(ByVal reportHost As IMetricsReportHost) ' Basic Score Card reportHost.AddHeader("Summary") reportHost.AddMetricDouble("Profit", True, False, 2, "Profit") reportHost.AddMetricDouble("ProfitPct", True, True, 2, "Net Profit %") reportHost.AddMetricDouble("ProfitPerBar", True, False, 2, "Profit per Bar") reportHost.AddMetricDouble("APR", True, True, 2, "APR") reportHost.AddMetricDouble("Exposure", False, True, 2, "Exposure") reportHost.AddMetricDouble("MaxExposure", False, True, 2, "Max Exposure") reportHost.AddMetricDouble("Alpha", False, False, 2, "Alpha") reportHost.AddMetricDouble("Beta", False, False, 2, "Beta") reportHost.AddMetricDouble("SharpeRatio", False, False, 2, "Sharpe Ratio") reportHost.AddMetricDouble("SortinoRatio", False, False, 2, "Sortino Ratio") reportHost.AddMetricDouble("WLScore", False, False, 2, "WL Score") reportHost.AddMetricDouble("CorrBenchmark", False, False, 2, "Benchmark Correlation") reportHost.AddSeparator() reportHost.AddHeader("Interest & Commission") reportHost.AddMetricDouble("Commission", True, False, 2, "Commission Paid") reportHost.AddMetricDouble("CashInterest", True, False, 2, "Cash Interest Received") reportHost.AddMetricDouble("MarginInterest", True, False, 2, "Margin Interest Paid") reportHost.AddMetricDouble("MaxMargin", False, False, 2, "Maximum Margin Used") reportHost.AddMetricDouble("Dividends", True, False, 2, "Dividends Received") reportHost.AddSeparator() reportHost.AddHeader("Positions") reportHost.AddMetricInt("PositionCount", "Position Count") reportHost.AddMetricDouble("AvgProfit", True, False, 2, "Avg Profit") reportHost.AddMetricDouble("AvgProfitPct", True, True, 2, "Avg Profit %") reportHost.AddMetricDouble("ProfitFactor", False, False, 2, "Profit Factor") reportHost.AddMetricDouble("PayoffRatio", False, False, 2, "Payoff Ratio") reportHost.AddMetricDouble("AvgBarsHeld", False, False, 2, "Avg Bars Held") reportHost.AddMetricDouble("AvgTradesPerMonth", False, False, 2, "Avg Trades Per Month") reportHost.AddMetricDouble("NSFPositionCount", False, False, 2, "NSF Position Count") reportHost.AddSeparator() reportHost.AddHeader("Drawdown") reportHost.AddMetricDouble("MaxDrawdown", True, False, 2, "Max Drawdown") reportHost.AddMetricDateTime("MaxDrawdownDate", "Max DrawdownDate") reportHost.AddMetricDouble("MaxDrawdownPct", True, True, 2, "Max Drawdown %") reportHost.AddMetricDateTime("MaxDrawdownPctDate", "Max Drawdown % Date") reportHost.AddMetricDouble("RecoveryFactor", False, False, 2, "Recovery Factor") reportHost.AddSeparator() reportHost.AddHeader("Profitable Positions") reportHost.AddMetricDouble("GrossProfitWinners", True, False, 2, "Gross Profit") reportHost.AddMetricInt("CountWinners", "Count") reportHost.AddMetricDouble("WinRate", False, True, 2, "% Profitable") reportHost.AddMetricDouble("AvgProfitWinners", True, False, 2, "Avg Proft") reportHost.AddMetricDouble("AvgProfitPctWinners", True, True, 2, "Avg Profit %") reportHost.AddMetricDouble("AvgBarsHeldWinners", False, False, 2, "Avg Bars Held") reportHost.AddSeparator() reportHost.AddHeader("Unprofitable Positions") reportHost.AddMetricDouble("GrossLossLosers", True, False, 2, "Gross Loss") reportHost.AddMetricInt("CountLosers", "Count") reportHost.AddMetricDouble("LossRate", False, True, 2, "% Unprofitable") reportHost.AddMetricDouble("AvgLossLosers", True, False, 2, "Avg Loss") reportHost.AddMetricDouble("AvgLossPctLosers", True, True, 2, "Avg Loss %") reportHost.AddMetricDouble("AvgBarsHeldLosers", False, False, 2, "Avg Bars Held") reportHost.AddSeparator() ' Extended Score Card reportHost.AddHeader("Trade Statistics") reportHost.AddMetricInt("MaxConsecutiveWins", "Max Consecutive Wins") reportHost.AddMetricInt("MaxConsecutiveLosses", "Max Consecutive Losses") reportHost.AddMetricDouble("TTest", True, False, 2, "T-Test") reportHost.AddMetricDouble("LuckCoefficient", True, False, 2, "Luck Coefficient") reportHost.AddMetricDouble("PerformanceRatio", True, False, 2, "Performance Ratio") reportHost.AddMetricDouble("PessimisticROR", True, False, 2, "Pessimistic Rate of Return") reportHost.AddMetricDouble("ERatio", True, False, 2, "E-Ratio") reportHost.AddMetricDouble("MedianProfit", True, False, 2, "Median Profit") reportHost.AddMetricDouble("MedianProfitPct", True, False, 2, "Median Profit %") reportHost.AddMetricInt("SymbolsTraded", "Symbols Traded") reportHost.AddSeparator() reportHost.AddHeader("Trade efficiency") reportHost.AddMetricDouble("AvgEntryEfficiencyPct", True, True, 2, "Average Entry Efficiency %") reportHost.AddMetricDouble("AvgExitEfficiencyPct", True, True, 2, "Average Exit Efficiency %") reportHost.AddMetricDouble("AvgTotalEfficiencyPct", True, True, 2, "Average Total Efficiency %") reportHost.AddSeparator() reportHost.AddHeader("Outlier analysis") reportHost.AddMetricDouble("StandardDeviationOfProfits", True, False, 2, "Standard Deviation Of Profits") reportHost.AddMetricInt("TotalOutliers", "Total Outliers") reportHost.AddMetricInt("PositiveOutliers", "Positive Outliers") reportHost.AddMetricInt("NegativeOutliers", "Negative Outliers") reportHost.AddMetricDouble("OutlierProfit", True, False, 2, "Outlier Profit") reportHost.AddMetricDouble("SelectNetProfit", True, False, 2, "Select Net Profit") reportHost.AddMetricDouble("SelectNetProfitAdjusted", True, False, 2, "Select Net Profit, Adjusted") reportHost.AddSeparator() reportHost.AddHeader("Outlier analysis (adjusted)") reportHost.AddMetricDouble("StandardDeviationOfProfitsPct", True, False, 2, "Standard Deviation Of Profits %") reportHost.AddSeparator() reportHost.AddMetricDouble("TotalOutliersPct", True, False, 2, "Total Outliers %") reportHost.AddMetricDouble("PositiveOutliersPct", True, False, 2, "Positive Outliers %") reportHost.AddMetricDouble("NegativeOutliersPct", True, False, 2, "Negative Outliers %") reportHost.AddSeparator() reportHost.AddMetricInt("TotalOutliersPct", "Total Outliers %") reportHost.AddMetricInt("PositiveOutliersPct", "Positive Outliers %") reportHost.AddMetricInt("NegativeOutliersPct", "Negative Outliers %") reportHost.AddSeparator() reportHost.AddMetricDouble("OutlierProfitPct", True, False, 2, "Outlier Profit %") reportHost.AddMetricDouble("SelectNetProfitPct", True, True, 2, "Select Net Profit %") reportHost.AddSeparator() reportHost.AddHeader("Drawdown") reportHost.AddMetricInt("LongestDrawdown", "Longest Drawdown") reportHost.AddMetricDouble("AverageDrawdownPct", True, True, 2, "Average Drawdown %") reportHost.AddMetricDouble("NewHighsPct", True, True, 2, "Percent New Highs") reportHost.AddMetricInt("NumberOfDrawdowns", "Number Of Drawdowns") reportHost.AddMetricDouble("RecoveryFactor", False, False, 2, "Recovery Factor") reportHost.AddSeparator() reportHost.AddHeader("Risk/Reward") reportHost.AddMetricDouble("MARRatio", True, False, 2, "MAR Ratio") reportHost.AddMetricDouble("KRatio", True, False, 2, "K-Ratio") reportHost.AddMetricDouble("LakeRatio", True, False, 2, "Seykota Lake Ratio") reportHost.AddMetricDouble("UlcerIndex", True, False, 2, "Ulcer Index") reportHost.AddMetricDouble("UlcerPerformanceIndex", True, False, 2, "Ulcer Performance Index") reportHost.AddMetricDouble("APADRatio", True, False, 2, "APD Ratio") reportHost.AddMetricDouble("APDRatio", True, False, 2, "APAD Ratio") reportHost.AddMetricDouble("MEGANRatio", True, False, 2, "MEGAN Ratio") reportHost.AddMetricDouble("TailRatio", True, False, 2, "Tail Ratio") reportHost.AddMetricDouble("UpsideCaptureRatio", True, False, 2, "Upside Capture Ratio") reportHost.AddMetricDouble("DownsideCaptureRatio", True, False, 2, "Downside Capture Ratio") reportHost.AddMetricDouble("CaptureRatio", True, False, 2, "Capture Ratio") reportHost.AddSeparator() reportHost.AddHeader("Risk/Reward Ratio") reportHost.AddMetricDouble("ExpectancyTraditional", True, False, 2, "Expectancy (traditional)") reportHost.AddSeparator() reportHost.AddHeader("Risk of Ruin") reportHost.AddMetricDouble("RiskOfRuinPct10", True, True, 2, "Risk of ruin = -10%") reportHost.AddMetricDouble("RiskOfRuinPct25", True, True, 2, "Risk of ruin = -25%") reportHost.AddMetricDouble("RiskOfRuinPct50", True, True, 2, "Risk of ruin = -50%") reportHost.AddMetricDouble("RiskOfRuinPct75", True, True, 2, "Risk of ruin = -75%") End Sub



0
- ago
#7
QUOTE:
All scorecards metrics are calculated held in the bt.metrics object at the end of a backtest run which is exposed to custom cards for adding new metrics.

Could it be that it's made possible by virtue of the lucky class name choice (UTM_Scorecard)? I mean if the order of execution preceded the other scorecards by being named alphabetically the first (e.g. ATM_Scorecard... vs Basic, Extended, UTM...), the metrics could have been null because they'd be called after your scorecard?
0
- ago
#8
Ahh.. ofcourse! Now everyone will be renaming their scorecard "ZZZZZZZ"
0
Glitch8
 ( 9.28% )
- ago
#9
That should not make any difference, WL7 should calculate a metric on demand even from another ScoreCard lower down alphabetically.
1
- ago
#10
Good to know, I think it deserves to be mentioned in the API guide.
2

Reply

Bookmark

Sort