HistoryEmulationConnector
The emulation connection. It uses historical data and/or occasionally generated.
Inherits: BaseEmulationConnector
Constructors
HistoryEmulationConnector(IMessageAdapter, bool, IMessageChannel, ISecurityProvider, IPortfolioProvider, IExchangeInfoProvider)
Initializes a new instance of the HistoryEmulationConnector.
- innerAdapter
- Underlying adapter.
- ownInnerAdapter
- Control lifetime.
- inChannel
- Incoming messages channel.
- 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.
HistoryEmulationConnector(ISecurityProvider, IPortfolioProvider, IExchangeInfoProvider, IStorageRegistry)
Initializes a new instance of the HistoryEmulationConnector.
- 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.
- exchangeInfoProvider
- Exchanges and trading boards provider.
HistoryEmulationConnector(ISecurityProvider)
Initializes a new instance of the HistoryEmulationConnector.
- securityProvider
- The provider of information about instruments.
HistoryEmulationConnector(ISecurityProvider, IEnumerable<Portfolio>)
Initializes a new instance of the HistoryEmulationConnector.
- securityProvider
- The provider of information about instruments.
- portfolios
- Portfolios, the operation will be performed with.
HistoryEmulationConnector(IEnumerable<Security>, IEnumerable<Portfolio>, IStorageRegistry)
Initializes a new instance of the HistoryEmulationConnector.
- securities
- Instruments, the operation will be performed with.
- portfolios
- Portfolios, the operation will be performed with.
- storageRegistry
- Market data storage.
HistoryEmulationConnector(IEnumerable<Security>, IEnumerable<Portfolio>)
Initializes a new instance of the HistoryEmulationConnector.
- securities
- Instruments, which will be sent through the SecurityReceived event.
- portfolios
- Portfolios, which will be sent through the PortfolioReceived event.
HistoryEmulationConnector(ISecurityProvider, IPortfolioProvider, IStorageRegistry)
Initializes a new instance of the HistoryEmulationConnector.
- 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.
HistoryEmulationConnector(ISecurityProvider, IPortfolioProvider, IExchangeInfoProvider)
Initializes a new instance of the HistoryEmulationConnector.
- 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.
Properties
CommissionRules : IEnumerable<ICommissionRule>
Commission rules.
EmulationSettings : MarketEmulatorSettings
Settings
HistoryMessageAdapter : HistoryMessageAdapter
The adapter, receiving messages form the storage IStorageRegistry.
IsFinished : bool
Has the emulator ended its operation due to end of data, or it was interrupted through the Disconnectmethod.
MarketTimeChangedInterval : TimeSpan
The interval of message TimeMessage generation.
MaxMessageCount : int
Maximum number of messages processed during backtesting. Negative value means the option is ignored.
RiskManager : IRiskManager
Risk manager.
State : ChannelStates
The emulator state.
StopOnSubscriptionError : bool
Call Disconnect when any Subscription failed.
SupportSnapshots : bool
Use SnapshotHolderMessageAdapter.
Methods
ClearCacheAsync(CancellationToken) : ValueTask
Clear cache.
DisposeManaged()
Release resources.
OnConnectAsync(CancellationToken) : ValueTask
Connect to trading system.
OnDisconnectAsync(CancellationToken) : ValueTask
Disconnect from trading system.
OnProcessMessage(Message, CancellationToken) : ValueTask
Process message.
- message
- Message.
- cancellationToken
- CancellationToken
StartAsync(CancellationToken) : ValueTask
To start the emulation.
SuspendAsync(CancellationToken) : ValueTask
To suspend the emulation.
Events
ProgressChanged : Action<int>
Progress changed event.
StateChanged : Action
The event on the emulator state change State.
StateChanged2 : Action<ChannelStates>
The event on the emulator state change State.