Table of Contents

Interface IConnector

Namespace
StockSharp.BusinessEntities
Assembly
StockSharp.BusinessEntities.dll

The main interface providing the connection to the trading systems.

public interface IConnector : IPersistable, ILogReceiver, ILogSource, IMarketDataProvider, ITransactionProvider, IPositionProvider, IPortfolioProvider, ISecurityProvider, ISecurityMessageProvider, INewsProvider, IMessageChannel, IDisposable, ICloneable<IMessageChannel>, ICloneable
Inherited Members
Extension Methods

Properties

CanConnect

Determines this connector is ready for establish connection.

bool CanConnect { get; }

Property Value

bool

ConnectionState

Connection state.

ConnectionStates ConnectionState { get; }

Property Value

ConnectionStates

ExchangeBoards

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

IEnumerable<ExchangeBoard> ExchangeBoards { get; }

Property Value

IEnumerable<ExchangeBoard>

MarketDataAdapter

Market-data adapter.

IMessageAdapter MarketDataAdapter { get; }

Property Value

IMessageAdapter

MyTrades

Get all own trades.

[Obsolete("Use NewMyTrade event to collect data.")]
IEnumerable<MyTrade> MyTrades { get; }

Property Value

IEnumerable<MyTrade>

News

All news.

[Obsolete("Use NewNews event to collect data.")]
IEnumerable<News> News { get; }

Property Value

IEnumerable<News>

OrderCancelFails

Get all cancellation errors.

[Obsolete("Use OrderCancelFailed event to collect data.")]
IEnumerable<OrderFail> OrderCancelFails { get; }

Property Value

IEnumerable<OrderFail>

OrderRegisterFails

Get all registration errors.

[Obsolete("Use OrderRegisterFailed event to collect data.")]
IEnumerable<OrderFail> OrderRegisterFails { get; }

Property Value

IEnumerable<OrderFail>

Orders

Get all orders.

[Obsolete("Use NewOrder event to collect data.")]
IEnumerable<Order> Orders { get; }

Property Value

IEnumerable<Order>

RegisteredMarketDepths

List of all securities, subscribed via RegisteredMarketDepths.

IEnumerable<Security> RegisteredMarketDepths { get; }

Property Value

IEnumerable<Security>

RegisteredOrderLogs

IEnumerable<Security> RegisteredOrderLogs { get; }

Property Value

IEnumerable<Security>

RegisteredPortfolios

List of all portfolios, subscribed via RegisterPortfolio(Portfolio).

IEnumerable<Portfolio> RegisteredPortfolios { get; }

Property Value

IEnumerable<Portfolio>

RegisteredSecurities

IEnumerable<Security> RegisteredSecurities { get; }

Property Value

IEnumerable<Security>

RegisteredTrades

IEnumerable<Security> RegisteredTrades { get; }

Property Value

IEnumerable<Security>

Securities

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

IEnumerable<Security> Securities { get; }

Property Value

IEnumerable<Security>

StopOrders

Get all stop-orders.

[Obsolete("Use NewStopOrder event to collect data.")]
IEnumerable<Order> StopOrders { get; }

Property Value

IEnumerable<Order>

Trades

Get all tick trades.

[Obsolete("Use NewTrade event to collect data.")]
IEnumerable<Trade> Trades { get; }

Property Value

IEnumerable<Trade>

TransactionAdapter

Transactional adapter.

IMessageAdapter TransactionAdapter { get; }

Property Value

IMessageAdapter

Methods

Connect()

Connect to trading system.

void Connect()

Disconnect()

Disconnect from trading system.

void Disconnect()

GetSecurity(SecurityId)

Get security by identifier.

Security GetSecurity(SecurityId securityId)

Parameters

securityId SecurityId

Security ID.

Returns

Security

Security.

GetSecurityId(Security)

SecurityId GetSecurityId(Security security)

Parameters

security Security

Security.

Returns

SecurityId

Security ID.

GetSessionState(ExchangeBoard)

Get session state for required board.

SessionStates? GetSessionState(ExchangeBoard board)

Parameters

board ExchangeBoard

Electronic board.

Returns

SessionStates?

Session state. If the information about session state does not exist, then null will be returned.

RegisterMarketDepth(Security, DateTimeOffset?, DateTimeOffset?, long?, MarketDataBuildModes, DataType, int?, IMessageAdapter)

To start getting quotes (order book) by the instrument. Quotes values are available through the event MarketDepthsChanged.

[Obsolete("Use SubscribeMarketDepth method instead.")]
void RegisterMarketDepth(Security security, DateTimeOffset? from = null, DateTimeOffset? to = null, long? count = null, MarketDataBuildModes buildMode = MarketDataBuildModes.LoadAndBuild, DataType buildFrom = null, int? maxDepth = null, IMessageAdapter adapter = null)

Parameters

security Security

The instrument by which quotes getting should be started.

from DateTimeOffset?

The initial date from which you need to get data.

to DateTimeOffset?

The final date by which you need to get data.

count long?

Max count.

buildMode MarketDataBuildModes

Build mode.

buildFrom DataType

Which market-data type is used as a source value.

maxDepth int?

Max depth of requested order book.

adapter IMessageAdapter

Target adapter. Can be null.

RegisterNews(Security, IMessageAdapter)

Subscribe on news.

[Obsolete("Use SubscribeNews method instead.")]
void RegisterNews(Security security = null, IMessageAdapter adapter = null)

Parameters

security Security

Security for subscription.

adapter IMessageAdapter

Target adapter. Can be null.

RegisterOrderLog(Security, DateTimeOffset?, DateTimeOffset?, long?, IMessageAdapter)

Subscribe on order log for the security.

[Obsolete("Use SubscribeOrderLog method instead.")]
void RegisterOrderLog(Security security, DateTimeOffset? from = null, DateTimeOffset? to = null, long? count = null, IMessageAdapter adapter = null)

Parameters

security Security

Security for subscription.

from DateTimeOffset?

The initial date from which you need to get data.

to DateTimeOffset?

The final date by which you need to get data.

count long?

Max count.

adapter IMessageAdapter

Target adapter. Can be null.

RegisterSecurity(Security, DateTimeOffset?, DateTimeOffset?, long?, MarketDataBuildModes, DataType, IMessageAdapter)

To start getting new information (for example, LastTick or BestBid) by the instrument.

[Obsolete("Use SubscribeLevel1 method instead.")]
void RegisterSecurity(Security security, DateTimeOffset? from = null, DateTimeOffset? to = null, long? count = null, MarketDataBuildModes buildMode = MarketDataBuildModes.LoadAndBuild, DataType buildFrom = null, IMessageAdapter adapter = null)

Parameters

security Security

The instrument by which new information getting should be started.

from DateTimeOffset?

The initial date from which you need to get data.

to DateTimeOffset?

The final date by which you need to get data.

count long?

Max count.

buildMode MarketDataBuildModes

Build mode.

buildFrom DataType

Which market-data type is used as a source value.

adapter IMessageAdapter

Target adapter. Can be null.

RegisterTrades(Security, DateTimeOffset?, DateTimeOffset?, long?, MarketDataBuildModes, DataType, IMessageAdapter)

To start getting trades (tick data) by the instrument. New trades will come through the event NewTrades.

[Obsolete("Use SubscribeTrades method instead.")]
void RegisterTrades(Security security, DateTimeOffset? from = null, DateTimeOffset? to = null, long? count = null, MarketDataBuildModes buildMode = MarketDataBuildModes.LoadAndBuild, DataType buildFrom = null, IMessageAdapter adapter = null)

Parameters

security Security

The instrument by which trades getting should be started.

from DateTimeOffset?

The initial date from which you need to get data.

to DateTimeOffset?

The final date by which you need to get data.

count long?

Max count.

buildMode MarketDataBuildModes

Build mode.

buildFrom DataType

Which market-data type is used as a source value.

adapter IMessageAdapter

Target adapter. Can be null.

SendOutMessage(Message)

Send outgoing message.

void SendOutMessage(Message message)

Parameters

message Message

Message.

UnRegisterMarketDepth(Security)

To stop getting quotes by the instrument.

[Obsolete("Use UnSubscribeMarketDepth method instead.")]
void UnRegisterMarketDepth(Security security)

Parameters

security Security

The instrument by which quotes getting should be stopped.

UnRegisterNews(Security)

Unsubscribe from news.

[Obsolete("Use UnSubscribeNews method instead.")]
void UnRegisterNews(Security security = null)

Parameters

security Security

Security for subscription.

UnRegisterOrderLog(Security)

Unsubscribe from order log for the security.

[Obsolete("Use UnSubscribeOrderLog method instead.")]
void UnRegisterOrderLog(Security security)

Parameters

security Security

Security for unsubscription.

UnRegisterSecurity(Security)

To stop getting new information.

[Obsolete("Use UnSubscribeLevel1 method instead.")]
void UnRegisterSecurity(Security security)

Parameters

security Security

The instrument by which new information getting should be stopped.

UnRegisterTrades(Security)

To stop getting trades (tick data) by the instrument.

[Obsolete("Use UnSubscribeTrades method instead.")]
void UnRegisterTrades(Security security)

Parameters

security Security

The instrument by which trades getting should be stopped.

Events

ChangePasswordResult

Change password result.

event Action<long, Exception> ChangePasswordResult

Event Type

Action<long, Exception>

Connected

Connected.

event Action Connected

Event Type

Action

ConnectedEx

Connected.

event Action<IMessageAdapter> ConnectedEx

Event Type

Action<IMessageAdapter>

ConnectionError

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

event Action<Exception> ConnectionError

Event Type

Action<Exception>

ConnectionErrorEx

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

event Action<IMessageAdapter, Exception> ConnectionErrorEx

Event Type

Action<IMessageAdapter, Exception>

ConnectionLost

Connection lost.

event Action<IMessageAdapter> ConnectionLost

Event Type

Action<IMessageAdapter>

ConnectionRestored

Connection restored.

event Action<IMessageAdapter> ConnectionRestored

Event Type

Action<IMessageAdapter>

Disconnected

Disconnected.

event Action Disconnected

Event Type

Action

DisconnectedEx

Disconnected.

event Action<IMessageAdapter> DisconnectedEx

Event Type

Action<IMessageAdapter>

Error

Data process error.

event Action<Exception> Error

Event Type

Action<Exception>

MarketDepthsChanged

Order books changed.

[Obsolete("Use single item event overload.")]
event Action<IEnumerable<MarketDepth>> MarketDepthsChanged

Event Type

Action<IEnumerable<MarketDepth>>

MarketTimeChanged

Server time changed ExchangeBoards. It passed the time difference since the last call of the event. The first time the event passes the value Zero.

event Action<TimeSpan> MarketTimeChanged

Event Type

Action<TimeSpan>

NewMarketDepths

Order books received.

[Obsolete("Use single item event overload.")]
event Action<IEnumerable<MarketDepth>> NewMarketDepths

Event Type

Action<IEnumerable<MarketDepth>>

NewMessage

Message processed Message.

event Action<Message> NewMessage

Event Type

Action<Message>

NewMyTrades

Own trades received.

[Obsolete("Use single item event overload.")]
event Action<IEnumerable<MyTrade>> NewMyTrades

Event Type

Action<IEnumerable<MyTrade>>

NewOrderLogItems

Order log received.

[Obsolete("Use single item event overload.")]
event Action<IEnumerable<OrderLogItem>> NewOrderLogItems

Event Type

Action<IEnumerable<OrderLogItem>>

NewOrders

Orders received.

[Obsolete("Use single item event overload.")]
event Action<IEnumerable<Order>> NewOrders

Event Type

Action<IEnumerable<Order>>

NewPortfolios

Portfolios received.

[Obsolete("Use single item event overload.")]
event Action<IEnumerable<Portfolio>> NewPortfolios

Event Type

Action<IEnumerable<Portfolio>>

NewPositions

Positions received.

[Obsolete("Use single item event overload.")]
event Action<IEnumerable<Position>> NewPositions

Event Type

Action<IEnumerable<Position>>

NewSecurities

Securities received.

[Obsolete("Use single item event overload.")]
event Action<IEnumerable<Security>> NewSecurities

Event Type

Action<IEnumerable<Security>>

NewStopOrders

Stop-orders received.

[Obsolete("Use single item event overload.")]
event Action<IEnumerable<Order>> NewStopOrders

Event Type

Action<IEnumerable<Order>>

NewTrades

Tick trades received.

[Obsolete("Use single item event overload.")]
event Action<IEnumerable<Trade>> NewTrades

Event Type

Action<IEnumerable<Trade>>

OrdersCancelFailed

Order cancellation errors event.

[Obsolete("Use single item event overload.")]
event Action<IEnumerable<OrderFail>> OrdersCancelFailed

Event Type

Action<IEnumerable<OrderFail>>

OrdersChanged

Orders changed (cancelled, matched).

[Obsolete("Use single item event overload.")]
event Action<IEnumerable<Order>> OrdersChanged

Event Type

Action<IEnumerable<Order>>

OrdersRegisterFailed

Order registration errors event.

[Obsolete("Use single item event overload.")]
event Action<IEnumerable<OrderFail>> OrdersRegisterFailed

Event Type

Action<IEnumerable<OrderFail>>

PortfoliosChanged

Portfolios changed.

[Obsolete("Use single item event overload.")]
event Action<IEnumerable<Portfolio>> PortfoliosChanged

Event Type

Action<IEnumerable<Portfolio>>

PositionsChanged

Positions changed.

[Obsolete("Use single item event overload.")]
event Action<IEnumerable<Position>> PositionsChanged

Event Type

Action<IEnumerable<Position>>

SecuritiesChanged

Securities changed.

[Obsolete("Use single item event overload.")]
event Action<IEnumerable<Security>> SecuritiesChanged

Event Type

Action<IEnumerable<Security>>

SessionStateChanged

Session changed.

event Action<ExchangeBoard, SessionStates> SessionStateChanged

Event Type

Action<ExchangeBoard, SessionStates>

StopOrdersCancelFailed

Stop-order cancellation errors event.

[Obsolete("Use single item event overload.")]
event Action<IEnumerable<OrderFail>> StopOrdersCancelFailed

Event Type

Action<IEnumerable<OrderFail>>

StopOrdersChanged

Stop orders state change event.

[Obsolete("Use single item event overload.")]
event Action<IEnumerable<Order>> StopOrdersChanged

Event Type

Action<IEnumerable<Order>>

StopOrdersRegisterFailed

Stop-order registration errors event.

[Obsolete("Use single item event overload.")]
event Action<IEnumerable<OrderFail>> StopOrdersRegisterFailed

Event Type

Action<IEnumerable<OrderFail>>