BaseOptimizer

StockSharp.Algo.Strategies.Optimization

The base optimizer of strategies.

继承自: BaseLogReceiver

构造函数

BaseOptimizer(ISecurityProvider, IPortfolioProvider, IExchangeInfoProvider, IStorageRegistry, StorageFormats, IMarketDataDrive)

Initializes a new instance of the BaseOptimizer.

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.

属性

EmulationSettings : OptimizerSettings

Emulation settings.

IsPaused : bool

Whether optimization is currently paused.

PortfolioProvider : IPortfolioProvider

IPortfolioProvider

SecurityProvider : ISecurityProvider

ISecurityProvider

StopOnSubscriptionError : bool

StopOnSubscriptionError

StorageSettings : StorageCoreSettings

Storage settings.

方法

AllocateAdapterCache() : MarketDataStorageCache

Allocate AdapterCache.

返回值: AdapterCache

AllocateStorageCache() : MarketDataStorageCache

Allocate StorageCache.

返回值: StorageCache

CompleteChannel()

Complete the channel so RunAsync enumeration ends.

DisposeManaged()

Release resources.

FreeAdapterCache(MarketDataStorageCache)

Free AdapterCache.

cache
AdapterCache
FreeStorageCache(MarketDataStorageCache)

Free StorageCache.

cache
StorageCache
InitializeRunAsync(int, CancellationToken)

Initialize channel, batch manager, and linked CTS for RunAsync.

totalIterations
Total number of iterations (or int.MaxValue if unknown).
cancellationToken
External cancellation token.
Pause() : Task

Pause optimization. New iterations won't start until Resume is called, and the backtests that are already running are suspended so progress halts promptly.

返回值: Task

Resume() : Task

Resume paused optimization.

返回值: Task

TryNextRunAsync(DateTime, DateTime, Func<IPortfolioProvider, ValueTuple?<Strategy, IStrategyParam[]>>, MarketDataStorageCache, MarketDataStorageCache, CancellationToken) : ValueTask<bool>

Try start next iteration. Returns if iteration was started and completed, if no more iterations available.

startTime
Date in history for starting the paper trading.
stopTime
Date in history to stop the paper trading (date is included).
tryGetNext
Handler to try to get next strategy object.
adapterCache
AdapterCache
storageCache
StorageCache
cancellationToken
Cancellation token.

事件

ConnectorInitialized : Action<Connector>

Init Connector. Called before Connect.

SingleProgressChanged : Action<Strategy, IStrategyParam[], int>

The event of single progress change.

StrategyInitialized : Action<Strategy, IStrategyParam[]>

Strategy initialized event.