Search Framework:
OptimizationResultList
Namespace: WealthLab.Backtest
Parent: List<OptimizationResult>

OptimizationResultList is a List of OptimizationResult instances that provides helper methods for locating results, filtering results, and persisting or restoring the list.

Members
Name
public string Name

Contains an optional name for the result list. This allows the list to be identified when it is passed to tools such as Filter Sets.



Methods
FindBest
public OptimizationResult FindBest(string metric, bool highestValue)

Returns the OptimizationResult in the list having the best value for the specified metric. If highestValue is true, the result with the highest metric value is returned. If highestValue is false, the result with the lowest metric value is returned. Only OptimizationResult instances whose PerformanceMetrics contain the specified metric are considered. Returns null if no matching metric is found.


FindMetric
public double FindMetric(string metric, List<double> paramValues)

Searches the list for an OptimizationResult whose ParameterValues match the values specified in paramValues and returns the corresponding performance metric. Parameter values are compared after being formatted to four decimal places. If no matching OptimizationResult is found, returns Double.NaN.


GetFilteredResults
public OptimizationResultList GetFilteredResults(List<OptimizationResultFilter> filter)

Returns a new OptimizationResultList containing only the OptimizationResult instances that satisfy all of the conditions specified in filter. Each OptimizationResultFilter compares a performance metric against its configured value using its CompareOperand. Supported comparisons include equal to, not equal to, greater than, greater than or equal to, less than, and less than or equal to. Before filtering begins, each filter item's Observations value is reset to zero. As results are examined, Observations is incremented whenever an individual filter condition is satisfied. An OptimizationResult is included in the returned list only when it satisfies every filter condition.


Parse
public static OptimizationResultList Parse(string s)

Creates and returns an OptimizationResultList from the persisted string representation specified in s. Each persisted OptimizationResult is parsed and added to the resulting list.


Persist
public string Persist()

Returns a persisted string representation of the OptimizationResultList, including each OptimizationResult contained in the list.