Framework Reference
WEALTHLAB FRAMEWORK / CLASS REFERENCE

OptimizationResult

API documentation, members, signatures, and C# examples.

Search the framework

Find classes, members, and documentation.

NamespaceWealthLab.Backtest
Parent
Object
Descendants

The OptimizationResult class contains the results of a single optimization run, including the Parameter values used, calculated performance metrics, run information, and any error that occurred during the run.

Members

16

AnnualizedReturn

public double AnnualizedReturn

Contains the annualized return of the optimization run. This value is used when calculating Walk-Forward Optimization (WFO) Efficiency. The default value is Double.NaN.

ErrorMessage

public string ErrorMessage

Contains the message from an Exception that occurred during the optimization run, or null if no Exception occurred.

Exception

public Exception Exception

Contains the Exception instance that occurred during the optimization run, or null if no Exception occurred.

GetMetricValue

public double GetMetricValue(string metricName)

Returns the value of the performance metric specified in metricName. If PerformanceMetrics does not contain the specified metric, returns Double.NaN.

GetPreferredValueList

public PreferredValueList GetPreferredValueList(IOptimizerHost optHost)

Creates and returns a PreferredValueList based on this optimization result's ParameterValues and the optimizable Parameters exposed by the specified optHost. Each generated PreferredValue contains the Parameter name and corresponding value from this optimization run.

Name

public string Name

Contains an optional name for the optimization result. This value is used when displaying results in the Filter Sets tool.

Opacity

public double Opacity

Controls the display opacity of the optimization result in interfaces such as the Filter Sets tool. Filtered results can use a reduced opacity to appear dimmed. The default value is 1.0.

ParameterValues

public List<double> ParameterValues

Returns the Parameter values used for this optimization run, in the same order as the Parameters being optimized.

Parse

public virtual void Parse(string s)

Restores the OptimizationResult from its persisted string representation specified in s. The restored information includes RunNumber, Symbol, ParameterValues, PerformanceMetrics, AnnualizedReturn, ErrorMessage, and, for newer persisted versions, Name.

PerformanceMetrics

public Dictionary<string, double> PerformanceMetrics

Contains the performance metrics calculated for the optimization run, keyed by metric name. The metrics included are determined by the performance metrics selected for the optimization.

Persist

public virtual string Persist()

Returns a persisted string representation of the OptimizationResult. The persisted information includes RunNumber, Symbol, ParameterValues, PerformanceMetrics, AnnualizedReturn, ErrorMessage, and Name.

ReturnedFromCache

public bool ReturnedFromCache

Returns true if this OptimizationResult was returned from an existing cached optimization result rather than produced by executing a new backtest. The default value is false.

RunNumber

public int RunNumber

Contains the chronological run number of this optimization result.

Symbol

public string Symbol

Contains the symbol associated with this result when the optimization is being performed on a symbol-by-symbol basis.

Tag

public object Tag

Contains optional information that an Optimizer can associate with this OptimizationResult. The meaning of this value is determined by the Optimizer using it.

ToString

public override string ToString()

Returns a comma-delimited string containing the values in ParameterValues, with each value formatted to two decimal places.

Need help with this API?

Ask the community or explore custom development services.