IConnector

StockSharp.BusinessEntities

Основной интерфейс, обеспечивающий подключение к торговым системам.

Реализует: IMessageTransport, IPersistable, ILogReceiver, ILogSource, IDisposable, IMarketDataProvider, ITransactionProvider, ISecurityProvider, ISecurityMessageProvider, ISubscriptionProvider, ITimeProvider, IPortfolioProvider, IPositionProvider

Свойства

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

Определяет, что connector готов к установлению соединения.

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

Состояние соединения.

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

Перечень всех биржевых досок, на которые загружены инструменты финансовых инструментов.

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

Адаптер рыночных данных.

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

Перечень всех загруженных инструментов. Называть его следует после события SecurityReceivedвозникшего. В противном случае пустой набор будет возвращен.

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

Трансакционный адаптер.

Методы

Connect
public void Connect()
iConnector.Connect()

Подключитесь к торговой системе.

Disconnect
public void Disconnect()
iConnector.Disconnect()

Отключиться от торговой системы.

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

Получить финансовый инструмент по идентификатору.

securityId
идентификатор финансового инструмента.

Возвращает: финансовый инструмент.

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

Получить финансовый инструмент по идентификатору.

securityId
идентификатор финансового инструмента.
cancellationToken
CancellationToken

Возвращает: финансовый инструмент.

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

Получите SecurityId.

security
финансовый инструмент.

Возвращает: идентификатор финансового инструмента.

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

Отправить исходящее сообщение.

message
Сообщение.
SendOutMessageAsync
public ValueTask SendOutMessageAsync(Message message, CancellationToken cancellationToken)
result = iConnector.SendOutMessageAsync(message, cancellationToken)

Отправить исходящее сообщение.

message
Сообщение.
cancellationToken
CancellationToken

События

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

Результат смены пароля.

Connected
public event Action Connected
iConnector.Connected += handler

Подключено.

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

Подключено.

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

Ошибка подключения (например, соединение было прервано сервером).

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

Ошибка подключения (например, соединение было прервано сервером).

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

Соединение потеряно.

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

Соединение восстановлено.

Disconnected
public event Action Disconnected
iConnector.Disconnected += handler

Отключено.

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

Отключено.

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

Ошибка обработки данных.