Table of Contents

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, 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 ISecurityProvider

The provider of information about instruments.

portfolioProvider IPortfolioProvider

The portfolio to be used to register orders. If value is not given, the portfolio with default name Simulator will be created.

exchangeInfoProvider IExchangeInfoProvider

Exchanges and trading boards provider.

storageRegistry IStorageRegistry

Market data storage.

storageFormat StorageFormats

The format of market data. Binary is used by default.

drive IMarketDataDrive

The storage which is used by default. By default, DefaultDrive is used.

GeneticOptimizer(ISecurityProvider, IPortfolioProvider, IStorageRegistry)

Initializes a new instance of the GeneticOptimizer.

public GeneticOptimizer(ISecurityProvider securityProvider, IPortfolioProvider portfolioProvider, IStorageRegistry storageRegistry)

Parameters

securityProvider ISecurityProvider

The provider of information about instruments.

portfolioProvider IPortfolioProvider

The portfolio to be used to register orders. If value is not given, the portfolio with default name Simulator will be created.

storageRegistry IStorageRegistry

Market data storage.

Properties

Settings

public GeneticSettings Settings { get; }

Property Value

GeneticSettings

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 DateTime

Date in history for starting the paper trading.

stopTime DateTime

Date in history to stop the paper trading (date is included).

strategy Strategy

Strategy.

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 ISelection

GeneticSharp.ISelection. If null the value from Selection will be used.

crossover ICrossover

GeneticSharp.ICrossover. If null the value from Crossover will be used.

mutation IMutation

GeneticSharp.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()