Class GeneticOptimizer
- Namespace
- StockSharp.Algo.Strategies.Optimization
- Assembly
- StockSharp.Algo.dll
The genetic optimizer of strategies.
public class GeneticOptimizer : BaseOptimizer, IPersistable, ILogReceiver, ILogSource, IDisposable
- Inheritance
-
GeneticOptimizer
- Implements
- Inherited Members
- Extension Methods
Constructors
GeneticOptimizer(ISecurityProvider, IPortfolioProvider, IStorageRegistry)
Initializes a new instance of the GeneticOptimizer.
public GeneticOptimizer(ISecurityProvider securityProvider, IPortfolioProvider portfolioProvider, IStorageRegistry storageRegistry)
Parameters
securityProviderISecurityProviderThe provider of information about instruments.
portfolioProviderIPortfolioProviderThe portfolio to be used to register orders. If value is not given, the portfolio with default name Simulator will be created.
storageRegistryIStorageRegistryMarket data storage.
GeneticOptimizer(ISecurityProvider, IPortfolioProvider, IExchangeInfoProvider, IStorageRegistry, StorageFormats, IMarketDataDrive)
Initializes a new instance of the GeneticOptimizer.
public GeneticOptimizer(ISecurityProvider securityProvider, IPortfolioProvider portfolioProvider, IExchangeInfoProvider exchangeInfoProvider, IStorageRegistry storageRegistry, StorageFormats storageFormat, IMarketDataDrive drive)
Parameters
securityProviderISecurityProviderThe provider of information about instruments.
portfolioProviderIPortfolioProviderThe portfolio to be used to register orders. If value is not given, the portfolio with default name Simulator will be created.
exchangeInfoProviderIExchangeInfoProviderExchanges and trading boards provider.
storageRegistryIStorageRegistryMarket data storage.
storageFormatStorageFormatsThe format of market data. Binary is used by default.
driveIMarketDataDriveThe storage which is used by default. By default, DefaultDrive is used.
Properties
Settings
public GeneticSettings Settings { get; }
Property Value
Methods
GetProgress()
Get progress value. 0..100 or null if progress is unknown.
protected override int? GetProgress()
Returns
- int?
Operation result.
Resume()
To resume the optimization.
public override void Resume()
Start(DateTime, DateTime, Strategy, IEnumerable<(IStrategyParam param, object from, object to, object step, IEnumerable values)>, Func<Strategy, decimal>, ISelection, ICrossover, IMutation)
Start optimization.
[CLSCompliant(false)]
public void Start(DateTime startTime, DateTime stopTime, Strategy strategy, IEnumerable<(IStrategyParam param, object from, object to, object step, IEnumerable values)> parameters, Func<Strategy, decimal> calcFitness = null, ISelection selection = null, ICrossover crossover = null, IMutation mutation = null)
Parameters
startTimeDateTimeDate in history for starting the paper trading.
stopTimeDateTimeDate in history to stop the paper trading (date is included).
strategyStrategyStrategy.
parametersIEnumerable<(IStrategyParam param, object from, object to, object step, IEnumerable values)>Parameters used to generate chromosomes.
calcFitnessFunc<Strategy, decimal>Calc fitness value function. If null the value from Fitness will be used.
selectionISelectionGeneticSharp.ISelection. If null the value from Selection will be used.
crossoverICrossoverGeneticSharp.ICrossover. If null the value from Crossover will be used.
mutationIMutationGeneticSharp.IMutation. If null the value from Mutation will be used.
Stop()
To stop optimization.
public override void Stop()
Suspend()
To suspend the optimization.
public override void Suspend()