AnnualizedReturn
public double AnnualizedReturnInherited from OptimizationResult. Contains the annualized return of the optimization result. WFOOptimizer uses the in-sample and out-of-sample AnnualizedReturn values when calculating WFOEfficiency.
API documentation, members, signatures, and C# examples.
Find classes, members, and documentation.
The WFOResult class extends OptimizationResult with information specific to a single Walk-Forward Optimization interval. A WFOResult can represent either the in-sample optimization result or the corresponding out-of-sample result for an interval. It also stores the date ranges, WFO Efficiency, selected parameter values and performance metrics inherited from OptimizationResult, and optional details about the complete in-sample optimization. WFOResult is also used to represent the optional Pre-Live WFO run.
public double AnnualizedReturnInherited from OptimizationResult. Contains the annualized return of the optimization result. WFOOptimizer uses the in-sample and out-of-sample AnnualizedReturn values when calculating WFOEfficiency.
public double AvgBarsContains the average number of BarHistory bars available across the symbols used for this WFO result. This is useful for examining how much historical data was actually available within a particular WFO interval.
public StrategyOptimizer BaseOptimizationContains the StrategyOptimizer that produced the in-sample optimization for this WFO interval. This gives callers access to the complete collection of OptimizationResult instances generated during the in-sample optimization. BaseOptimization is normally associated with an in-sample WFOResult. It can be null when no underlying optimization is available.
public string DateRangeReturns the appropriate formatted date range for this result. For an in-sample result, this returns InSampleRange. For an out-of-sample result, this returns OutOfSampleRange.
public DateTime EndDateReturns the ending date appropriate for this result. For an in-sample result:
InSampleEndDate
For an out-of-sample result:
OutOfSampleEndDate
public string ErrorMessageInherited from OptimizationResult. Contains the Exception message associated with the optimization result if an error occurred. Returns null when no error was recorded.
public string InOutSampleReturns a descriptive string identifying the type of WFO result. Possible values are:
public DateTime InSampleEndDateThe ending date of the in-sample portion of this WFO interval.
public string InSampleRangeReturns the in-sample date range as a formatted string: InSampleStartDate to InSampleEndDate.
public DateTime InSampleStartDateThe starting date of the in-sample portion of this WFO interval.
public int IntervalNumberThe interval number associated with this WFOResult. WFOOptimizer numbers normal intervals starting at 1. If Pre-Live processing is enabled, the Pre-Live result uses:
Intervals + 1
public bool IsInSampleIndicates whether this WFOResult represents an in-sample result. The default value is true. For normal WFO runs:
public bool IsNormalRunReturns true if this result is not a Pre-Live result. Equivalent to: !IsPreLiveRun
public bool IsPreLiveRunReturns true if this WFOResult represents the optional Pre-Live run. A Pre-Live result is identified by: OutOfSampleStartDate == DateTime.MinValue WFOOptimizer uses a special open-ended out-of-sample date range for Pre-Live results because there is no historical out-of-sample period following the final optimization.
public int MaxBarsContains the maximum number of BarHistory bars available for any symbol used in this WFO result.
public List<string> MetricNamesInherited from OptimizationResult. Returns the names of the performance metrics associated with the optimization result. These metrics are determined by the ScoreCard used during optimization.
public int MinBarsContains the minimum number of BarHistory bars available for any symbol used in this WFO result.
public DateTime OutOfSampleEndDateThe ending date of the out-of-sample portion of this WFO interval. For a Pre-Live result this is typically DateTime.MaxValue.
public string OutOfSampleRangeReturns the out-of-sample date range as a formatted string:
OutOfSampleStartDate to OutOfSampleEndDate
public DateTime OutOfSampleStartDateThe starting date of the out-of-sample portion of this WFO interval. For a Pre-Live result, this is DateTime.MinValue.
public List<double> ParameterValuesInherited from OptimizationResult. Contains the parameter values represented by this optimization result. For a completed WFO interval, these are the parameter values selected from the in-sample optimization and used for the corresponding out-of-sample test.
public Dictionary<string, double> PerformanceMetricsInherited from OptimizationResult. Contains the performance metric values calculated for this result. The available metrics are determined by the ScoreCard used during the optimization.
public int RunNumberInherited from OptimizationResult. Returns the run number associated with the optimization result.
public DateTime SortDateReturns the date used for chronological sorting. For an in-sample result, this returns: InSampleStartDate. For an out-of-sample result, it returns: OutOfSampleStartDate.
public DateTime StartDateReturns the starting date appropriate for this result. For an in-sample result: InSampleStartDate. For an out-of-sample result: OutOfSampleStartDate.
public TimeSpan TimeSpanReturns the complete time span represented by the WFO interval. For a normal WFO result, this is calculated as: OutOfSampleEndDate - InSampleStartDate. For a Pre-Live result, it is calculated as: InSampleEndDate - InSampleStartDate.
public string TimeSpanStringReturns TimeSpan formatted as a human-readable duration.
public override string ToString()Returns a string containing both the in-sample and out-of-sample date ranges. The format is: InSampleStart-InSampleEnd, OutOfSampleStart-OutOfSampleEnd.
public double WFOEfficiencyContains the Walk-Forward Optimization Efficiency for this interval. WFOOptimizer calculates this by comparing the annualized return of the out-of-sample run with the annualized return of the corresponding in-sample result. Conceptually: OOS Annualized Return / IS Annualized Return � 100. A value of 100 means the out-of-sample annualized return matched the in-sample annualized return. A value below 100 indicates deterioration out of sample, while a value above 100 indicates stronger out-of-sample performance.
public string WFOEfficiencyDisplayReturns WFOEfficiency formatted to two decimal places for an in-sample result. Returns an empty string for an out-of-sample result. This allows the WFO Efficiency value to be displayed once per interval rather than repeated on both the in-sample and out-of-sample rows.
public override void Parse(string s)Restores a WFOResult from a string created by Persist. In addition to the OptimizationResult base-class data, the method restores:
public override string Persist()Serializes the WFOResult. The serialized value includes the inherited OptimizationResult data as well as the WFO-specific date ranges, interval information, WFO Efficiency, in/out-of-sample state, BaseOptimization results, and bar-count statistics.
Ask the community or explore custom development services.