IConnector

StockSharp.BusinessEntities

The main interface providing the connection to the trading systems.

Implements: IMessageTransport, IPersistable, ILogReceiver, ILogSource, IDisposable, IMarketDataProvider, ITransactionProvider, ISecurityProvider, ISecurityMessageProvider, ISubscriptionProvider, ITimeProvider, IPortfolioProvider, IPositionProvider

Properties

CanConnect
public bool CanConnect { get; }
value = iConnector.CanConnect

Determines this connector is ready for establish connection.

ConnectionState
public ConnectionStates ConnectionState { get; }
value = iConnector.ConnectionState

Connection state.

ExchangeBoards
public IEnumerable<ExchangeBoard> ExchangeBoards { get; }
value = iConnector.ExchangeBoards

List of all exchange boards, for which instruments are loaded Securities.

MarketDataAdapter
public IMessageAdapter MarketDataAdapter { get; }
value = iConnector.MarketDataAdapter

Market-data adapter.

Securities
public IEnumerable<Security> Securities { get; }
value = iConnector.Securities

List of all loaded instruments. It should be called after event SecurityReceived arisen. Otherwise the empty set will be returned.

TransactionAdapter
public IMessageAdapter TransactionAdapter { get; }
value = iConnector.TransactionAdapter

Transactional adapter.

Methods

Connect
public void Connect()
iConnector.Connect()

Connect to trading system.

Disconnect
public void Disconnect()
iConnector.Disconnect()

Disconnect from trading system.

GetSecurity
public Security GetSecurity(SecurityId securityId)
result = iConnector.GetSecurity(securityId)

Get security by identifier.

securityId
Security ID.

Returns: Security.

GetSecurityAsync
public ValueTask<Security> GetSecurityAsync(SecurityId securityId, CancellationToken cancellationToken)
result = iConnector.GetSecurityAsync(securityId, cancellationToken)

Get security by identifier.

securityId
Security ID.
cancellationToken
CancellationToken

Returns: Security.

GetSecurityId
public SecurityId GetSecurityId(Security security)
result = iConnector.GetSecurityId(security)

Get SecurityId.

security
Security.

Returns: Security ID.

SendOutMessage
public void SendOutMessage(Message message)
iConnector.SendOutMessage(message)

Send outgoing message.

message
Message.
SendOutMessageAsync
public ValueTask SendOutMessageAsync(Message message, CancellationToken cancellationToken)
result = iConnector.SendOutMessageAsync(message, cancellationToken)

Send outgoing message.

message
Message.
cancellationToken
CancellationToken

Events

ChangePasswordResult
public event Action<long, Exception> ChangePasswordResult
iConnector.ChangePasswordResult += handler

Change password result.

Connected
public event Action Connected
iConnector.Connected += handler

Connected.

ConnectedEx
public event Action<IMessageAdapter> ConnectedEx
iConnector.ConnectedEx += handler

Connected.

ConnectionError
public event Action<Exception> ConnectionError
iConnector.ConnectionError += handler

Connection error (for example, the connection was aborted by server).

ConnectionErrorEx
public event Action<IMessageAdapter, Exception> ConnectionErrorEx
iConnector.ConnectionErrorEx += handler

Connection error (for example, the connection was aborted by server).

ConnectionLost
public event Action<IMessageAdapter> ConnectionLost
iConnector.ConnectionLost += handler

Connection lost.

ConnectionRestored
public event Action<IMessageAdapter> ConnectionRestored
iConnector.ConnectionRestored += handler

Connection restored.

Disconnected
public event Action Disconnected
iConnector.Disconnected += handler

Disconnected.

DisconnectedEx
public event Action<IMessageAdapter> DisconnectedEx
iConnector.DisconnectedEx += handler

Disconnected.

Error
public event Action<Exception> Error
iConnector.Error += handler

Data process error.