I got a little
, after all having the following to get the value of custom metrics is not the most intuitive: // Find a the value of a specific custom Performance Metric named "MyPerformanceMetric"
for (int i = 0; i < SystemPerformance.AllTrades.TradesPerformance.PerformanceMetrics.Length; i++)
{
if (SystemPerformance.AllTrades.TradesPerformance.PerformanceMetrics[i] is
NinjaTrader.NinjaScript.PerformanceMetrics.MyPerformanceMetric)
{
Print((SystemPerformance.AllTrades.TradesPerformance.PerformanceMetrics[i] as
NinjaTrader.NinjaScript.PerformanceMetrics.MyPerformanceMetric).Values[0]);
}
}
PerformanceMetrics.SampleCumProfit myMetric = (PerformanceMetrics.SampleCumProfit)strategy.PerformanceMetrics.FirstOrDefault(p => p.Name == "SampleCumProfit");
Print("Sample Cum Profit"+myMetric.Values[0]);

, for sure much friendlier. I'll take a look at changing. Earlier on in the documentation process we decided not to use LINQ since we didn't want to introduce the new concept but you for sure have a point in this specific example.
Comment