Interface IConnector
The main interface providing the connection to the trading systems.
Inherited Members
Namespace: StockSharp.BusinessEntities
Assembly: StockSharp.BusinessEntities.dll
Syntax
public interface IConnector : IPersistable, ILogReceiver, ILogSource, IMarketDataProvider, ITransactionProvider, IPositionProvider, IPortfolioProvider, ISecurityProvider, INewsProvider, IMessageChannel, IDisposable, ICloneable<IMessageChannel>, ICloneable
Properties
ConnectionState
Connection state.
Declaration
ConnectionStates ConnectionState { get; }
Property Value
Type | Description |
---|---|
ConnectionStates |
ExchangeBoards
List of all exchange boards, for which instruments are loaded Securities.
Declaration
IEnumerable<ExchangeBoard> ExchangeBoards { get; }
Property Value
Type | Description |
---|---|
IEnumerable<ExchangeBoard> |
MarketDataAdapter
Market-data adapter.
Declaration
IMessageAdapter MarketDataAdapter { get; }
Property Value
Type | Description |
---|---|
IMessageAdapter |
MyTrades
Get all own trades.
Declaration
IEnumerable<MyTrade> MyTrades { get; }
Property Value
Type | Description |
---|---|
IEnumerable<MyTrade> |
News
All news.
Declaration
IEnumerable<News> News { get; }
Property Value
Type | Description |
---|---|
IEnumerable<News> |
OrderCancelFails
Get all cancellation errors.
Declaration
IEnumerable<OrderFail> OrderCancelFails { get; }
Property Value
Type | Description |
---|---|
IEnumerable<OrderFail> |
OrderRegisterFails
Get all registration errors.
Declaration
IEnumerable<OrderFail> OrderRegisterFails { get; }
Property Value
Type | Description |
---|---|
IEnumerable<OrderFail> |
Orders
Get all orders.
Declaration
IEnumerable<Order> Orders { get; }
Property Value
Type | Description |
---|---|
IEnumerable<Order> |
RegisteredMarketDepths
List of all securities, subscribed via RegisteredMarketDepths.
Declaration
IEnumerable<Security> RegisteredMarketDepths { get; }
Property Value
Type | Description |
---|---|
IEnumerable<Security> |
RegisteredOrderLogs
List of all securities, subscribed via RegisterOrderLog(Security, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, Nullable<Int64>, IMessageAdapter).
Declaration
IEnumerable<Security> RegisteredOrderLogs { get; }
Property Value
Type | Description |
---|---|
IEnumerable<Security> |
RegisteredPortfolios
List of all portfolios, subscribed via RegisterPortfolio(Portfolio).
Declaration
IEnumerable<Portfolio> RegisteredPortfolios { get; }
Property Value
Type | Description |
---|---|
IEnumerable<Portfolio> |
RegisteredSecurities
List of all securities, subscribed via RegisterSecurity(Security, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, Nullable<Int64>, MarketDataBuildModes, DataType, IMessageAdapter).
Declaration
IEnumerable<Security> RegisteredSecurities { get; }
Property Value
Type | Description |
---|---|
IEnumerable<Security> |
RegisteredTrades
List of all securities, subscribed via RegisterTrades(Security, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, Nullable<Int64>, MarketDataBuildModes, DataType, IMessageAdapter).
Declaration
IEnumerable<Security> RegisteredTrades { get; }
Property Value
Type | Description |
---|---|
IEnumerable<Security> |
Securities
List of all loaded instruments. It should be called after event NewSecurities arisen. Otherwise the empty set will be returned.
Declaration
IEnumerable<Security> Securities { get; }
Property Value
Type | Description |
---|---|
IEnumerable<Security> |
StopOrders
Get all stop-orders.
Declaration
IEnumerable<Order> StopOrders { get; }
Property Value
Type | Description |
---|---|
IEnumerable<Order> |
Trades
Get all tick trades.
Declaration
IEnumerable<Trade> Trades { get; }
Property Value
Type | Description |
---|---|
IEnumerable<Trade> |
TransactionAdapter
Transactional adapter.
Declaration
IMessageAdapter TransactionAdapter { get; }
Property Value
Type | Description |
---|---|
IMessageAdapter |
Methods
Connect()
Connect to trading system.
Declaration
void Connect()
Disconnect()
Disconnect from trading system.
Declaration
void Disconnect()
GetSecurity(SecurityId)
Get security by identifier.
Declaration
Security GetSecurity(SecurityId securityId)
Parameters
Type | Name | Description |
---|---|---|
SecurityId | securityId | Security ID. |
Returns
Type | Description |
---|---|
Security | Security. |
GetSecurityId(Security)
Get SecurityId.
Declaration
SecurityId GetSecurityId(Security security)
Parameters
Type | Name | Description |
---|---|---|
Security | security | Security. |
Returns
Type | Description |
---|---|
SecurityId | Security ID. |
GetSessionState(ExchangeBoard)
Get session state for required board.
Declaration
Nullable<SessionStates> GetSessionState(ExchangeBoard board)
Parameters
Type | Name | Description |
---|---|---|
ExchangeBoard | board | Electronic board. |
Returns
Type | Description |
---|---|
Nullable<SessionStates> | Session state. If the information about session state does not exist, then null will be returned. |
RegisterMarketDepth(Security, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, Nullable<Int64>, MarketDataBuildModes, DataType, Nullable<Int32>, IMessageAdapter)
To start getting quotes (order book) by the instrument. Quotes values are available through the event MarketDepthsChanged.
Declaration
void RegisterMarketDepth(Security security, Nullable<DateTimeOffset> from = null, Nullable<DateTimeOffset> to = null, Nullable<long> count = null, MarketDataBuildModes buildMode, DataType buildFrom = null, Nullable<int> maxDepth = null, IMessageAdapter adapter = null)
Parameters
Type | Name | Description |
---|---|---|
Security | security | The instrument by which quotes getting should be started. |
Nullable<DateTimeOffset> | from | The initial date from which you need to get data. |
Nullable<DateTimeOffset> | to | The final date by which you need to get data. |
Nullable<Int64> | count | Max count. |
MarketDataBuildModes | buildMode | Build mode. |
DataType | buildFrom | Which market-data type is used as a source value. |
Nullable<Int32> | maxDepth | Max depth of requested order book. |
IMessageAdapter | adapter | Target adapter. Can be null. |
RegisterNews(Security, IMessageAdapter)
Subscribe on news.
Declaration
void RegisterNews(Security security = null, IMessageAdapter adapter = null)
Parameters
Type | Name | Description |
---|---|---|
Security | security | Security for subscription. |
IMessageAdapter | adapter | Target adapter. Can be null. |
RegisterOrderLog(Security, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, Nullable<Int64>, IMessageAdapter)
Subscribe on order log for the security.
Declaration
void RegisterOrderLog(Security security, Nullable<DateTimeOffset> from = null, Nullable<DateTimeOffset> to = null, Nullable<long> count = null, IMessageAdapter adapter = null)
Parameters
Type | Name | Description |
---|---|---|
Security | security | Security for subscription. |
Nullable<DateTimeOffset> | from | The initial date from which you need to get data. |
Nullable<DateTimeOffset> | to | The final date by which you need to get data. |
Nullable<Int64> | count | Max count. |
IMessageAdapter | adapter | Target adapter. Can be null. |
RegisterSecurity(Security, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, Nullable<Int64>, MarketDataBuildModes, DataType, IMessageAdapter)
Declaration
void RegisterSecurity(Security security, Nullable<DateTimeOffset> from = null, Nullable<DateTimeOffset> to = null, Nullable<long> count = null, MarketDataBuildModes buildMode, DataType buildFrom = null, IMessageAdapter adapter = null)
Parameters
Type | Name | Description |
---|---|---|
Security | security | The instrument by which new information getting should be started. |
Nullable<DateTimeOffset> | from | The initial date from which you need to get data. |
Nullable<DateTimeOffset> | to | The final date by which you need to get data. |
Nullable<Int64> | count | Max count. |
MarketDataBuildModes | buildMode | Build mode. |
DataType | buildFrom | Which market-data type is used as a source value. |
IMessageAdapter | adapter | Target adapter. Can be null. |
RegisterTrades(Security, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, Nullable<Int64>, MarketDataBuildModes, DataType, IMessageAdapter)
To start getting trades (tick data) by the instrument. New trades will come through the event NewTrades.
Declaration
void RegisterTrades(Security security, Nullable<DateTimeOffset> from = null, Nullable<DateTimeOffset> to = null, Nullable<long> count = null, MarketDataBuildModes buildMode, DataType buildFrom = null, IMessageAdapter adapter = null)
Parameters
Type | Name | Description |
---|---|---|
Security | security | The instrument by which trades getting should be started. |
Nullable<DateTimeOffset> | from | The initial date from which you need to get data. |
Nullable<DateTimeOffset> | to | The final date by which you need to get data. |
Nullable<Int64> | count | Max count. |
MarketDataBuildModes | buildMode | Build mode. |
DataType | buildFrom | Which market-data type is used as a source value. |
IMessageAdapter | adapter | Target adapter. Can be null. |
SendOutMessage(Message)
Send outgoing message.
Declaration
void SendOutMessage(Message message)
Parameters
Type | Name | Description |
---|---|---|
Message | message | Message. |
UnRegisterMarketDepth(Security)
To stop getting quotes by the instrument.
Declaration
void UnRegisterMarketDepth(Security security)
Parameters
Type | Name | Description |
---|---|---|
Security | security | The instrument by which quotes getting should be stopped. |
UnRegisterNews(Security)
Unsubscribe from news.
Declaration
void UnRegisterNews(Security security = null)
Parameters
Type | Name | Description |
---|---|---|
Security | security | Security for subscription. |
UnRegisterOrderLog(Security)
Unsubscribe from order log for the security.
Declaration
void UnRegisterOrderLog(Security security)
Parameters
Type | Name | Description |
---|---|---|
Security | security | Security for unsubscription. |
UnRegisterSecurity(Security)
To stop getting new information.
Declaration
void UnRegisterSecurity(Security security)
Parameters
Type | Name | Description |
---|---|---|
Security | security | The instrument by which new information getting should be stopped. |
UnRegisterTrades(Security)
To stop getting trades (tick data) by the instrument.
Declaration
void UnRegisterTrades(Security security)
Parameters
Type | Name | Description |
---|---|---|
Security | security | The instrument by which trades getting should be stopped. |
Events
ChangePasswordResult
Change password result.
Declaration
event Action<long, Exception> ChangePasswordResult
Event Type
Type | Description |
---|---|
Action<Int64, Exception> |
Connected
Connected.
Declaration
event Action Connected
Event Type
Type | Description |
---|---|
Action |
ConnectedEx
Connected.
Declaration
event Action<IMessageAdapter> ConnectedEx
Event Type
Type | Description |
---|---|
Action<IMessageAdapter> |
ConnectionError
Connection error (for example, the connection was aborted by server).
Declaration
event Action<Exception> ConnectionError
Event Type
Type | Description |
---|---|
Action<Exception> |
ConnectionErrorEx
Connection error (for example, the connection was aborted by server).
Declaration
event Action<IMessageAdapter, Exception> ConnectionErrorEx
Event Type
Type | Description |
---|---|
Action<IMessageAdapter, Exception> |
ConnectionLost
Connection lost.
Declaration
event Action<IMessageAdapter> ConnectionLost
Event Type
Type | Description |
---|---|
Action<IMessageAdapter> |
ConnectionRestored
Connection restored.
Declaration
event Action<IMessageAdapter> ConnectionRestored
Event Type
Type | Description |
---|---|
Action<IMessageAdapter> |
Disconnected
Disconnected.
Declaration
event Action Disconnected
Event Type
Type | Description |
---|---|
Action |
DisconnectedEx
Disconnected.
Declaration
event Action<IMessageAdapter> DisconnectedEx
Event Type
Type | Description |
---|---|
Action<IMessageAdapter> |
Error
Data process error.
Declaration
event Action<Exception> Error
Event Type
Type | Description |
---|---|
Action<Exception> |
MarketDepthsChanged
Order books changed.
Declaration
event Action<IEnumerable<MarketDepth>> MarketDepthsChanged
Event Type
Type | Description |
---|---|
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.
Declaration
event Action<TimeSpan> MarketTimeChanged
Event Type
Type | Description |
---|---|
Action<TimeSpan> |
NewMarketDepths
Order books received.
Declaration
event Action<IEnumerable<MarketDepth>> NewMarketDepths
Event Type
Type | Description |
---|---|
Action<IEnumerable<MarketDepth>> |
NewMessage
Message processed Message.
Declaration
event Action<Message> NewMessage
Event Type
Type | Description |
---|---|
Action<Message> |
NewMyTrades
Own trades received.
Declaration
event Action<IEnumerable<MyTrade>> NewMyTrades
Event Type
Type | Description |
---|---|
Action<IEnumerable<MyTrade>> |
NewOrderLogItems
Order log received.
Declaration
event Action<IEnumerable<OrderLogItem>> NewOrderLogItems
Event Type
Type | Description |
---|---|
Action<IEnumerable<OrderLogItem>> |
NewOrders
Orders received.
Declaration
event Action<IEnumerable<Order>> NewOrders
Event Type
Type | Description |
---|---|
Action<IEnumerable<Order>> |
NewPortfolios
Portfolios received.
Declaration
event Action<IEnumerable<Portfolio>> NewPortfolios
Event Type
Type | Description |
---|---|
Action<IEnumerable<Portfolio>> |
NewPositions
Positions received.
Declaration
event Action<IEnumerable<Position>> NewPositions
Event Type
Type | Description |
---|---|
Action<IEnumerable<Position>> |
NewSecurities
Securities received.
Declaration
event Action<IEnumerable<Security>> NewSecurities
Event Type
Type | Description |
---|---|
Action<IEnumerable<Security>> |
NewStopOrders
Stop-orders received.
Declaration
event Action<IEnumerable<Order>> NewStopOrders
Event Type
Type | Description |
---|---|
Action<IEnumerable<Order>> |
NewTrades
Tick trades received.
Declaration
event Action<IEnumerable<Trade>> NewTrades
Event Type
Type | Description |
---|---|
Action<IEnumerable<Trade>> |
OrdersCancelFailed
Order cancellation errors event.
Declaration
event Action<IEnumerable<OrderFail>> OrdersCancelFailed
Event Type
Type | Description |
---|---|
Action<IEnumerable<OrderFail>> |
OrdersChanged
Orders changed (cancelled, matched).
Declaration
event Action<IEnumerable<Order>> OrdersChanged
Event Type
Type | Description |
---|---|
Action<IEnumerable<Order>> |
OrdersRegisterFailed
Order registration errors event.
Declaration
event Action<IEnumerable<OrderFail>> OrdersRegisterFailed
Event Type
Type | Description |
---|---|
Action<IEnumerable<OrderFail>> |
PortfoliosChanged
Portfolios changed.
Declaration
event Action<IEnumerable<Portfolio>> PortfoliosChanged
Event Type
Type | Description |
---|---|
Action<IEnumerable<Portfolio>> |
PositionsChanged
Positions changed.
Declaration
event Action<IEnumerable<Position>> PositionsChanged
Event Type
Type | Description |
---|---|
Action<IEnumerable<Position>> |
SecuritiesChanged
Securities changed.
Declaration
event Action<IEnumerable<Security>> SecuritiesChanged
Event Type
Type | Description |
---|---|
Action<IEnumerable<Security>> |
SessionStateChanged
Session changed.
Declaration
event Action<ExchangeBoard, SessionStates> SessionStateChanged
Event Type
Type | Description |
---|---|
Action<ExchangeBoard, SessionStates> |
StopOrdersCancelFailed
Stop-order cancellation errors event.
Declaration
event Action<IEnumerable<OrderFail>> StopOrdersCancelFailed
Event Type
Type | Description |
---|---|
Action<IEnumerable<OrderFail>> |
StopOrdersChanged
Stop orders state change event.
Declaration
event Action<IEnumerable<Order>> StopOrdersChanged
Event Type
Type | Description |
---|---|
Action<IEnumerable<Order>> |
StopOrdersRegisterFailed
Stop-order registration errors event.
Declaration
event Action<IEnumerable<OrderFail>> StopOrdersRegisterFailed
Event Type
Type | Description |
---|---|
Action<IEnumerable<OrderFail>> |