GeneticOptimizer

StockSharp.Algo.Strategies.Optimization

The genetic optimizer of strategies.

继承自: BaseOptimizer

构造函数

GeneticOptimizer(ISecurityProvider, IPortfolioProvider, IStorageRegistry, IFileSystem)

Initializes a new instance of the GeneticOptimizer.

securityProvider
The provider of information about instruments.
portfolioProvider
The portfolio to be used to register orders. If value is not given, the portfolio with default name Simulator will be created.
storageRegistry
Market data storage.
fileSystem
File system.
GeneticOptimizer(ISecurityProvider, IPortfolioProvider, IExchangeInfoProvider, IStorageRegistry, StorageFormats, IMarketDataDrive, IFileSystem)

Initializes a new instance of the GeneticOptimizer.

securityProvider
The provider of information about instruments.
portfolioProvider
The portfolio to be used to register orders. If value is not given, the portfolio with default name Simulator will be created.
exchangeInfoProvider
Exchanges and trading boards provider.
storageRegistry
Market data storage.
storageFormat
The format of market data. Binary is used by default.
drive
The storage which is used by default. By default, DefaultDrive is used.
fileSystem
File system.
GeneticOptimizer(ISecurityProvider, IPortfolioProvider, IExchangeInfoProvider, IStorageRegistry, StorageFormats, IMarketDataDrive, IFitnessFormulaProvider)

Initializes a new instance of the GeneticOptimizer.

securityProvider
The provider of information about instruments.
portfolioProvider
The portfolio to be used to register orders. If value is not given, the portfolio with default name Simulator will be created.
exchangeInfoProvider
Exchanges and trading boards provider.
storageRegistry
Market data storage.
storageFormat
The format of market data. Binary is used by default.
drive
The storage which is used by default. By default, DefaultDrive is used.
formulaProvider
Fitness formula provider.

属性

Settings : GeneticSettings

GeneticSettings

方法

HasRemainingIterations() : bool

Check if there are remaining iterations.

RunAsync(DateTime, DateTime, Strategy, IEnumerable<ValueTuple<IStrategyParam, object, object, object, IEnumerable>>, Func<Strategy, decimal>, ISelection, ICrossover, IMutation, CancellationToken) : IAsyncEnumerable<ValueTuple<Strategy, IStrategyParam[]>>

Run optimization and yield completed iterations as they finish.

startTime
Date in history for starting the paper trading.
stopTime
Date in history to stop the paper trading (date is included).
strategy
Strategy.
parameters
Parameters used to generate chromosomes.
calcFitness
Calc fitness value function. If the value from Fitness will be used.
selection
ISelection. If the value from Selection will be used.
crossover
ICrossover. If the value from Crossover will be used.
mutation
IMutation. If the value from Mutation will be used.
cancellationToken
Cancellation token.

返回值: Async enumerable of completed (strategy, parameters) pairs.

TryConsumeIteration() : bool

Try to consume one iteration from the limit.

返回值: True if iteration was consumed, false if limit reached.