BacktestSettings
public BacktestSettings BacktestSettingsReturns the backtest settings (instance of the BacktestSettings class) being used for the optimization.
API documentation, members, signatures, and C# examples.
Find classes, members, and documentation.
Executes optimization runs for Optimizers. Optimizer extensions call the ExecuteOptimizationRun method to execute individual optimization runs, and Optimization Visualizers access the Results to represent optimization performance results.
public BacktestSettings BacktestSettingsReturns the backtest settings (instance of the BacktestSettings class) being used for the optimization.
public StrategyBase CompiledStrategyReturns the instance of the StrategyBase derived class that represents the compiled Strategy being optimized.
public OptimizerBase OptimizationMethodReturns the Optimizer (instance of an OptimizerBase derived class) selected for the optimization.
public IOptimizerHost OptimizerHostReturns the IOptimizerHost instance that allows an Optimizer to communicate information back to its host.
public PositionSize PositionSizeReturns the position size (instance of the PositionSize class) being used for the optimization.
public void ReportEstimatedCompletion(double value)Allows an Optimizer to report its estimated completion percentage to the host. The value parameter should be between 0 and 100.
public ScoreCardBase ScoreCardReturns the instance of the ScoreCard selected for the optimization.
public List<BarHistory> SymbolDataReturns a List of BarHistory instances containing the historical data being used for the optimization.
public void CompileUniqueParameterValues(ParameterList pl)Compiles the unique parameter values that were actually used during the optimization and assigns them to the OptimizedValues property of each Parameter in the supplied pl ParameterList. This is useful for Optimizers that do not necessarily test every possible value represented by a Parameter's MinValue, MaxValue, and StepValue.
public OptimizationResult ExecuteOptimizationRun(ParameterList pl, Backtester bmBacktester = null, bool addToResults = true)Executes an optimization run by performing a backtest of the Strategy using the parameter values specified in the pl ParameterList. Returns an instance of the OptimizationResult class containing the performance metrics and results of the run. Optimizer extensions normally only need to supply pl. The optional bmBacktester and addToResults parameters are used internally by WealthLab and can normally be ignored. If a run using the same parameter values has already been completed, WealthLab can return the previously calculated OptimizationResult instead of executing the backtest again.
public bool GeneratesResultsOutsideStepBoundaryReturns true if the Optimizer generated parameter values that fall outside the discrete values represented by the Parameters' MinValue, MaxValue, and StepValue settings. WealthLab determines this by examining up to the first 100 optimization results.
public List<double> GetUniqueValues(int idx)Returns a sorted List of the unique parameter values actually used during the optimization for the Parameter at index idx. Since many Optimizers are not exhaustive, the returned values can be a subset of the possible values represented by the Parameter's MinValue, MaxValue, and StepValue properties.
public void Initialize()Initializes the StrategyOptimizer for a new optimization operation by clearing its internally recorded completed runs.
public bool InWFOReturns true if this StrategyOptimizer is currently being used as part of a Walk-Forward Optimization (WFO).
public IOptimizationHost OptimizationHostReturns the IOptimizationHost instance hosting this StrategyOptimizer.
public OptimizationResultList ResultsReturns an instance of the OptimizationResultList class containing all recorded optimization runs. Each item in the list is an instance of the OptimizationResult class and contains the parameter values and performance results for one optimization run. Assigning a previously saved OptimizationResultList to this property also rebuilds the StrategyOptimizer's internal record of completed runs.
public OptimizationRunComplete RunCompleteAn optional delegate that is called whenever an optimization run completes. The delegate receives the completed OptimizationResult along with the estimated percentage of the overall optimization that has been completed.
Ask the community or explore custom development services.