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
ConnectionState
Connection state.
ConnectionStates ConnectionState { get; }
Property Value
ExchangeBoards
List of all exchange boards, for which instruments are loaded Securities.
IEnumerable<ExchangeBoard> ExchangeBoards { get; }
Property Value
MarketDataAdapter
Market-data adapter.
IMessageAdapter MarketDataAdapter { get; }
Property Value
MyTrades
Get all own trades.
[Obsolete("Use NewMyTrade event to collect data.")]
IEnumerable<MyTrade> MyTrades { get; }
Property Value
News
All news.
[Obsolete("Use NewNews event to collect data.")]
IEnumerable<News> News { get; }
Property Value
OrderCancelFails
Get all cancellation errors.
[Obsolete("Use OrderCancelFailed event to collect data.")]
IEnumerable<OrderFail> OrderCancelFails { get; }
Property Value
OrderRegisterFails
Get all registration errors.
[Obsolete("Use OrderRegisterFailed event to collect data.")]
IEnumerable<OrderFail> OrderRegisterFails { get; }
Property Value
Orders
Get all orders.
[Obsolete("Use NewOrder event to collect data.")]
IEnumerable<Order> Orders { get; }
Property Value
RegisteredMarketDepths
List of all securities, subscribed via RegisteredMarketDepths.
IEnumerable<Security> RegisteredMarketDepths { get; }
Property Value
RegisteredOrderLogs
List of all securities, subscribed via RegisterOrderLog(Security, DateTimeOffset?, DateTimeOffset?, long?, IMessageAdapter).
IEnumerable<Security> RegisteredOrderLogs { get; }
Property Value
RegisteredPortfolios
List of all portfolios, subscribed via RegisterPortfolio(Portfolio).
IEnumerable<Portfolio> RegisteredPortfolios { get; }
Property Value
RegisteredSecurities
List of all securities, subscribed via RegisterSecurity(Security, DateTimeOffset?, DateTimeOffset?, long?, MarketDataBuildModes, DataType, IMessageAdapter).
IEnumerable<Security> RegisteredSecurities { get; }
Property Value
RegisteredTrades
List of all securities, subscribed via RegisterTrades(Security, DateTimeOffset?, DateTimeOffset?, long?, MarketDataBuildModes, DataType, IMessageAdapter).
IEnumerable<Security> RegisteredTrades { get; }
Property Value
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
StopOrders
Get all stop-orders.
[Obsolete("Use NewStopOrder event to collect data.")]
IEnumerable<Order> StopOrders { get; }
Property Value
Trades
Get all tick trades.
[Obsolete("Use NewTrade event to collect data.")]
IEnumerable<Trade> Trades { get; }
Property Value
TransactionAdapter
Transactional adapter.
IMessageAdapter TransactionAdapter { get; }
Property Value
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
SecurityIdSecurity ID.
Returns
- Security
Security.
GetSecurityId(Security)
Get SecurityId.
SecurityId GetSecurityId(Security security)
Parameters
security
SecuritySecurity.
Returns
- SecurityId
Security ID.
GetSessionState(ExchangeBoard)
Get session state for required board.
SessionStates? GetSessionState(ExchangeBoard board)
Parameters
board
ExchangeBoardElectronic 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
SecurityThe 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
MarketDataBuildModesBuild mode.
buildFrom
DataTypeWhich market-data type is used as a source value.
maxDepth
int?Max depth of requested order book.
adapter
IMessageAdapterTarget 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
SecuritySecurity for subscription.
adapter
IMessageAdapterTarget 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
SecuritySecurity 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
IMessageAdapterTarget adapter. Can be null.
RegisterSecurity(Security, DateTimeOffset?, DateTimeOffset?, long?, MarketDataBuildModes, DataType, IMessageAdapter)
[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
SecurityThe 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
MarketDataBuildModesBuild mode.
buildFrom
DataTypeWhich market-data type is used as a source value.
adapter
IMessageAdapterTarget 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
SecurityThe 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
MarketDataBuildModesBuild mode.
buildFrom
DataTypeWhich market-data type is used as a source value.
adapter
IMessageAdapterTarget adapter. Can be null.
SendOutMessage(Message)
Send outgoing message.
void SendOutMessage(Message message)
Parameters
message
MessageMessage.
UnRegisterMarketDepth(Security)
To stop getting quotes by the instrument.
[Obsolete("Use UnSubscribeMarketDepth method instead.")]
void UnRegisterMarketDepth(Security security)
Parameters
security
SecurityThe 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
SecuritySecurity for subscription.
UnRegisterOrderLog(Security)
Unsubscribe from order log for the security.
[Obsolete("Use UnSubscribeOrderLog method instead.")]
void UnRegisterOrderLog(Security security)
Parameters
security
SecuritySecurity for unsubscription.
UnRegisterSecurity(Security)
To stop getting new information.
[Obsolete("Use UnSubscribeLevel1 method instead.")]
void UnRegisterSecurity(Security security)
Parameters
security
SecurityThe 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
SecurityThe instrument by which trades getting should be stopped.
Events
ChangePasswordResult
Change password result.
event Action<long, Exception> ChangePasswordResult
Event Type
Connected
Connected.
event Action Connected
Event Type
ConnectedEx
Connected.
event Action<IMessageAdapter> ConnectedEx
Event Type
ConnectionError
Connection error (for example, the connection was aborted by server).
event Action<Exception> ConnectionError
Event Type
ConnectionErrorEx
Connection error (for example, the connection was aborted by server).
event Action<IMessageAdapter, Exception> ConnectionErrorEx
Event Type
ConnectionLost
Connection lost.
event Action<IMessageAdapter> ConnectionLost
Event Type
ConnectionRestored
Connection restored.
event Action<IMessageAdapter> ConnectionRestored
Event Type
Disconnected
Disconnected.
event Action Disconnected
Event Type
DisconnectedEx
Disconnected.
event Action<IMessageAdapter> DisconnectedEx
Event Type
Error
Data process error.
event Action<Exception> Error
Event Type
MarketDepthsChanged
Order books changed.
[Obsolete("Use single item event overload.")]
event Action<IEnumerable<MarketDepth>> MarketDepthsChanged
Event Type
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
NewMarketDepths
Order books received.
[Obsolete("Use single item event overload.")]
event Action<IEnumerable<MarketDepth>> NewMarketDepths
Event Type
NewMessage
Message processed Message.
event Action<Message> NewMessage
Event Type
NewMyTrades
Own trades received.
[Obsolete("Use single item event overload.")]
event Action<IEnumerable<MyTrade>> NewMyTrades
Event Type
NewOrderLogItems
Order log received.
[Obsolete("Use single item event overload.")]
event Action<IEnumerable<OrderLogItem>> NewOrderLogItems
Event Type
NewOrders
Orders received.
[Obsolete("Use single item event overload.")]
event Action<IEnumerable<Order>> NewOrders
Event Type
NewPortfolios
Portfolios received.
[Obsolete("Use single item event overload.")]
event Action<IEnumerable<Portfolio>> NewPortfolios
Event Type
NewPositions
Positions received.
[Obsolete("Use single item event overload.")]
event Action<IEnumerable<Position>> NewPositions
Event Type
NewSecurities
Securities received.
[Obsolete("Use single item event overload.")]
event Action<IEnumerable<Security>> NewSecurities
Event Type
NewStopOrders
Stop-orders received.
[Obsolete("Use single item event overload.")]
event Action<IEnumerable<Order>> NewStopOrders
Event Type
NewTrades
Tick trades received.
[Obsolete("Use single item event overload.")]
event Action<IEnumerable<Trade>> NewTrades
Event Type
OrdersCancelFailed
Order cancellation errors event.
[Obsolete("Use single item event overload.")]
event Action<IEnumerable<OrderFail>> OrdersCancelFailed
Event Type
OrdersChanged
Orders changed (cancelled, matched).
[Obsolete("Use single item event overload.")]
event Action<IEnumerable<Order>> OrdersChanged
Event Type
OrdersRegisterFailed
Order registration errors event.
[Obsolete("Use single item event overload.")]
event Action<IEnumerable<OrderFail>> OrdersRegisterFailed
Event Type
PortfoliosChanged
Portfolios changed.
[Obsolete("Use single item event overload.")]
event Action<IEnumerable<Portfolio>> PortfoliosChanged
Event Type
PositionsChanged
Positions changed.
[Obsolete("Use single item event overload.")]
event Action<IEnumerable<Position>> PositionsChanged
Event Type
SecuritiesChanged
Securities changed.
[Obsolete("Use single item event overload.")]
event Action<IEnumerable<Security>> SecuritiesChanged
Event Type
SessionStateChanged
Session changed.
event Action<ExchangeBoard, SessionStates> SessionStateChanged
Event Type
StopOrdersCancelFailed
Stop-order cancellation errors event.
[Obsolete("Use single item event overload.")]
event Action<IEnumerable<OrderFail>> StopOrdersCancelFailed
Event Type
StopOrdersChanged
Stop orders state change event.
[Obsolete("Use single item event overload.")]
event Action<IEnumerable<Order>> StopOrdersChanged
Event Type
StopOrdersRegisterFailed
Stop-order registration errors event.
[Obsolete("Use single item event overload.")]
event Action<IEnumerable<OrderFail>> StopOrdersRegisterFailed