BaseEmulationConnector
The base connection of emulation.
Inherits: Connector
Constructors
protected BaseEmulationConnector(EmulationMessageAdapter emulationAdapter, bool applyHeartbeat, bool initChannels)
baseEmulationConnector = BaseEmulationConnector(emulationAdapter, applyHeartbeat, initChannels)
Initializes a new instance of the BaseEmulationConnector.
- emulationAdapter
- Emulation message adapter.
- applyHeartbeat
- Apply on/off heartbeat mode for the specified adapter.
- initChannels
- Initialize channels.
Properties
public override DateTime CurrentTime { get; }
value = baseEmulationConnector.CurrentTime
Current time, which will be passed to the Time.
public EmulationMessageAdapter EmulationAdapter { get; }
value = baseEmulationConnector.EmulationAdapter
The adapter, executing messages in IMarketEmulator.
public override IEnumerable<Portfolio> Portfolios { get; }
value = baseEmulationConnector.Portfolios
Get all portfolios.
public override bool UnsubscribeOnDisconnect { get; }
value = baseEmulationConnector.UnsubscribeOnDisconnect
Send unsubscribe on disconnect.
Methods
public override ValueTask ClearCacheAsync(CancellationToken cancellationToken)
result = baseEmulationConnector.ClearCacheAsync(cancellationToken)
Clear cache.
protected override void DisposeManaged()
baseEmulationConnector.DisposeManaged()
To release allocated resources. In particular, to disconnect from the trading system via Disconnect.
public override void Load(SettingsStorage storage)
baseEmulationConnector.Load(storage)
Loads the state of the object from the specified SettingsStorage.
- storage
- The SettingsStorage instance from which to load the data.
protected override ValueTask OnProcessMessage(Message message, CancellationToken cancellationToken)
result = baseEmulationConnector.OnProcessMessage(message, cancellationToken)
Process message.
- message
- Message.
- cancellationToken
- CancellationToken
public Subscription RegisterMarketDepth(MarketDepthGenerator generator)
result = baseEmulationConnector.RegisterMarketDepth(generator)
To register the order books generator.
- generator
- The order books generator.
Returns: Subscription.
public Subscription RegisterOrderLog(OrderLogGenerator generator)
result = baseEmulationConnector.RegisterOrderLog(generator)
To register the orders log generator.
- generator
- The orders log generator.
Returns: Subscription.
public Subscription RegisterTrades(TradeGenerator generator)
result = baseEmulationConnector.RegisterTrades(generator)
To register the trades generator.
- generator
- The trades generator.
Returns: Subscription.
public override void Save(SettingsStorage storage)
baseEmulationConnector.Save(storage)
Saves the state of the object to the specified SettingsStorage.
- storage
- The SettingsStorage instance to which to save the data.
public void UnRegisterMarketDepth(MarketDepthGenerator generator)
baseEmulationConnector.UnRegisterMarketDepth(generator)
To delete the order books generator, earlier registered through MarketDepthGenerator).
- generator
- The order books generator.
public void UnRegisterOrderLog(OrderLogGenerator generator)
baseEmulationConnector.UnRegisterOrderLog(generator)
To delete the orders log generator, earlier registered through OrderLogGenerator).
- generator
- The orders log generator.
public void UnRegisterTrades(TradeGenerator generator)
baseEmulationConnector.UnRegisterTrades(generator)
To delete the trades generator, registered earlier through TradeGenerator).
- generator
- The trades generator.