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
-
IPersistable
- 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
securityProvider
ISecurityProviderThe provider of information about instruments.
portfolioProvider
IPortfolioProviderThe portfolio to be used to register orders. If value is not given, the portfolio with default name Simulator will be created.
storageRegistry
IStorageRegistryMarket 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
securityProvider
ISecurityProviderThe provider of information about instruments.
portfolioProvider
IPortfolioProviderThe portfolio to be used to register orders. If value is not given, the portfolio with default name Simulator will be created.
exchangeInfoProvider
IExchangeInfoProviderExchanges and trading boards provider.
storageRegistry
IStorageRegistryMarket data storage.
storageFormat
StorageFormatsThe format of market data. Binary is used by default.
drive
IMarketDataDriveThe storage which is used by default. By default, DefaultDrive is used.
Properties
Settings
public GeneticSettings Settings { get; }
Property Value
Methods
GetProgress()
Get progress value.
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
startTime
DateTimeDate in history for starting the paper trading.
stopTime
DateTimeDate in history to stop the paper trading (date is included).
strategy
StrategyStrategy.
parameters
IEnumerable<(IStrategyParam param, object from, object to, object step, IEnumerable values)>Parameters used to generate chromosomes.
calcFitness
Func<Strategy, decimal>Calc fitness value function. If null the value from Fitness will be used.
selection
ISelectionGeneticSharp.ISelection. If null the value from Selection will be used.
crossover
ICrossoverGeneticSharp.ICrossover. If null the value from Crossover will be used.
mutation
IMutationGeneticSharp.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()