BaseOptimizer
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.
Свойства
AdapterCache : MarketDataStorageCache
AdapterCache.
EmulationSettings : OptimizerSettings
Emulation settings.
ExchangeInfoProvider : IExchangeInfoProvider
IExchangeInfoProvider
PortfolioProvider : IPortfolioProvider
IPortfolioProvider
SecurityProvider : ISecurityProvider
ISecurityProvider
StopOnSubscriptionError : bool
StopOnSubscriptionError
StorageCache : MarketDataStorageCache
StorageCache.
StorageSettings : StorageCoreSettings
Storage settings.
Методы
CompleteChannel()
Complete the channel so RunAsync enumeration ends.
DisposeManaged()
Release resources.
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
ReadResultsAsync(CancellationToken) : IAsyncEnumerable<ValueTuple<Strategy, IStrategyParam[]>>
Yield results from channel reader.
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.