Class Connector
- Namespace
- StockSharp.Algo
- Assembly
- StockSharp.Algo.dll
The class to create connections to trading systems.
public class Connector : BaseLogReceiver, IConnector, IPersistable, ILogReceiver, ILogSource, IMarketDataProvider, ITransactionProvider, IPositionProvider, IPortfolioProvider, ISecurityProvider, ISecurityMessageProvider, INewsProvider, IMessageChannel, IDisposable, ICloneable<IMessageChannel>, ICloneable, ISubscriptionProvider
- Inheritance
-
Connector
- Implements
-
IPersistableICloneable<IMessageChannel>
- Derived
- Inherited Members
- Extension Methods
Constructors
Connector()
Initializes a new instance of the Connector.
public Connector()
Connector(IEntityRegistry, IStorageRegistry, SnapshotRegistry, StorageBuffer)
Initializes a new instance of the Connector.
[Obsolete]
public Connector(IEntityRegistry entityRegistry, IStorageRegistry storageRegistry, SnapshotRegistry snapshotRegistry, StorageBuffer buffer = null)
Parameters
entityRegistry
IEntityRegistryThe storage of trade objects.
storageRegistry
IStorageRegistryThe storage of market data.
snapshotRegistry
SnapshotRegistrySnapshot storage registry.
buffer
StorageBufferStorage buffer.
Connector(ISecurityStorage, IPositionStorage, IExchangeInfoProvider, IStorageRegistry, SnapshotRegistry, StorageBuffer, bool, bool)
Initializes a new instance of the Connector.
public Connector(ISecurityStorage securityStorage, IPositionStorage positionStorage, IExchangeInfoProvider exchangeInfoProvider, IStorageRegistry storageRegistry = null, SnapshotRegistry snapshotRegistry = null, StorageBuffer buffer = null, bool initAdapter = true, bool initChannels = true)
Parameters
securityStorage
ISecurityStorageSecurities meta info storage.
positionStorage
IPositionStoragePosition storage.
exchangeInfoProvider
IExchangeInfoProviderExchanges and trading boards provider.
storageRegistry
IStorageRegistryThe storage of market data.
snapshotRegistry
SnapshotRegistrySnapshot storage registry.
buffer
StorageBufferStorage buffer.
initAdapter
boolInitialize basket adapter.
initChannels
boolInitialize channels.
Properties
Adapter
Message adapter.
public BasketMessageAdapter Adapter { get; protected set; }
Property Value
BasketSecurityProcessorProvider
Basket security processors provider.
public IBasketSecurityProcessorProvider BasketSecurityProcessorProvider { get; set; }
Property Value
Buffer
Storage buffer.
public StorageBuffer Buffer { get; }
Property Value
CanConnect
Determines this connector is ready for establish connection.
public bool CanConnect { get; }
Property Value
CheckSteps
public bool CheckSteps { get; set; }
Property Value
CommissionManager
The commission calculating manager.
public ICommissionManager CommissionManager { get; set; }
Property Value
ConnectionState
Connection state.
public ConnectionStates ConnectionState { get; }
Property Value
CreateAssociatedSecurity
Create a combined security for securities from different boards.
[Obsolete("Use SupportAssociatedSecurity property.")]
public bool CreateAssociatedSecurity { get; set; }
Property Value
CreateDepthFromLevel1
To update the order book for the instrument when the Level1ChangeMessage message appears. By default is enabled.
[Obsolete("Use SupportLevel1DepthBuilder property.")]
public bool CreateDepthFromLevel1 { get; set; }
Property Value
CreateDepthFromOrdersLog
Use orders log to create market depths. Disabled by default.
[Obsolete("Use MarketDataMessage.BuildFrom=OrderLog instead.")]
public bool CreateDepthFromOrdersLog { get; set; }
Property Value
CreateTradesFromOrdersLog
Use orders log to create ticks. Disabled by default.
[Obsolete("Use MarketDataMessage.BuildFrom=OrderLog instead.")]
public bool CreateTradesFromOrdersLog { get; set; }
Property Value
ErrorCount
The number of errors passed through the Error event.
public int ErrorCount { get; }
Property Value
ExchangeBoards
List of all exchange boards, for which instruments are loaded Securities.
public IEnumerable<ExchangeBoard> ExchangeBoards { get; }
Property Value
ExchangeInfoProvider
Exchanges and trading boards provider.
public IExchangeInfoProvider ExchangeInfoProvider { get; }
Property Value
InMessageChannel
Input message channel.
public IMessageChannel InMessageChannel { get; protected set; }
Property Value
InnerAdapter
Inner message adapter.
public IMessageAdapter InnerAdapter { get; set; }
Property Value
IsAutoPortfoliosSubscribe
Subscribe for new portfolios.
public bool IsAutoPortfoliosSubscribe { get; set; }
Property Value
Remarks
By default is true.
IsAutoUnSubscribeOnDisconnect
Send unsubscribe on disconnect command.
public bool IsAutoUnSubscribeOnDisconnect { get; set; }
Property Value
Remarks
By default is true.
IsRestoreSubscriptionOnNormalReconnect
Restore subscription on reconnect.
public bool IsRestoreSubscriptionOnNormalReconnect { get; set; }
Property Value
Remarks
Normal case connect/disconnect.
KeepStrategiesPositions
Process strategies positions and store it into Positions.
public bool KeepStrategiesPositions { get; set; }
Property Value
LatencyManager
Orders registration delay calculation manager.
public ILatencyManager LatencyManager { get; set; }
Property Value
LookupMessagesOnConnect
Send lookup messages on connect. By default is SecurityLookup, PortfolioLookup, OrderStatus, TimeFrameLookup.
public ISet<MessageTypes> LookupMessagesOnConnect { get; }
Property Value
MarketDataAdapter
Market-data adapter.
public IMessageAdapter MarketDataAdapter { get; }
Property Value
MarketTimeChangedInterval
The TimeMessage message generating Interval. The default is 10 milliseconds.
public virtual TimeSpan MarketTimeChangedInterval { get; set; }
Property Value
MyTrades
Get all own trades.
[Obsolete("Use NewMyTrade event to collect data.")]
public IEnumerable<MyTrade> MyTrades { get; }
Property Value
News
All news.
[Obsolete("Use NewNews event to collect data.")]
public IEnumerable<News> News { get; }
Property Value
OrderCancelFails
Get all cancellation errors.
[Obsolete("Use OrderCancelFailed event to collect data.")]
public IEnumerable<OrderFail> OrderCancelFails { get; }
Property Value
OrderRegisterFails
Get all registration errors.
[Obsolete("Use OrderRegisterFailed event to collect data.")]
public IEnumerable<OrderFail> OrderRegisterFails { get; }
Property Value
Orders
Get all orders.
[Obsolete("Use NewOrder event to collect data.")]
public IEnumerable<Order> Orders { get; }
Property Value
OrdersKeepCount
The number of orders for storage. The default is 1000. If the value is set to MaxValue, then the orders will not be deleted. If the value is set to 0, then the orders will not be stored.
public int OrdersKeepCount { get; set; }
Property Value
OutMessageChannel
Outgoing message channel.
public IMessageChannel OutMessageChannel { get; protected set; }
Property Value
OverrideSecurityData
Override previous security data by new values.
public bool OverrideSecurityData { get; set; }
Property Value
PnLManager
The profit-loss manager.
public IPnLManager PnLManager { get; set; }
Property Value
Portfolios
Get all portfolios.
public virtual IEnumerable<Portfolio> Portfolios { get; }
Property Value
PositionStorage
Position storage.
public IPositionStorage PositionStorage { get; }
Property Value
Positions
Get all positions.
public IEnumerable<Position> Positions { get; }
Property Value
ReConnectionSettings
Settings of the connection control IConnector to the trading system.
[Obsolete("Use exact IMessageAdapter to set reconnecting settings.")]
public ReConnectionSettings ReConnectionSettings { get; }
Property Value
RegisteredMarketDepths
List of all securities, subscribed via RegisteredMarketDepths.
public IEnumerable<Security> RegisteredMarketDepths { get; }
Property Value
RegisteredOrderLogs
List of all securities, subscribed via RegisterOrderLog(Security, DateTimeOffset?, DateTimeOffset?, long?, IMessageAdapter).
public IEnumerable<Security> RegisteredOrderLogs { get; }
Property Value
RegisteredPortfolios
List of all portfolios, subscribed via RegisterPortfolio(Portfolio).
public IEnumerable<Portfolio> RegisteredPortfolios { get; }
Property Value
RegisteredSecurities
List of all securities, subscribed via RegisterSecurity(Security, DateTimeOffset?, DateTimeOffset?, long?, MarketDataBuildModes, DataType, IMessageAdapter).
public IEnumerable<Security> RegisteredSecurities { get; }
Property Value
RegisteredTrades
List of all securities, subscribed via RegisterTrades(Security, DateTimeOffset?, DateTimeOffset?, long?, MarketDataBuildModes, DataType, IMessageAdapter).
public IEnumerable<Security> RegisteredTrades { get; }
Property Value
RiskManager
Risk control manager.
public virtual IRiskManager RiskManager { get; set; }
Property Value
Securities
List of all loaded instruments. It should be called after event NewSecurities arisen. Otherwise the empty set will be returned.
public IEnumerable<Security> Securities { get; }
Property Value
SecurityIdGenerator
The instrument identifiers generator Id.
public SecurityIdGenerator SecurityIdGenerator { get; set; }
Property Value
SecurityStorage
Securities meta info storage.
public ISecurityStorage SecurityStorage { get; }
Property Value
SlippageManager
Slippage manager.
public ISlippageManager SlippageManager { get; set; }
Property Value
SnapshotRegistry
Snapshot storage registry.
public SnapshotRegistry SnapshotRegistry { get; }
Property Value
StopOrders
Get all stop-orders.
[Obsolete("Use NewStopOrder event to collect data.")]
public IEnumerable<Order> StopOrders { get; }
Property Value
StorageAdapter
Storage adapter.
public StorageMetaInfoMessageAdapter StorageAdapter { get; }
Property Value
StorageRegistry
The storage of market data.
public IStorageRegistry StorageRegistry { get; }
Property Value
SubscribedCandleSeries
List of all candles series, subscribed via Subscribe(Subscription).
public IEnumerable<CandleSeries> SubscribedCandleSeries { get; }
Property Value
Subscriptions
Subscriptions.
public IEnumerable<Subscription> Subscriptions { get; }
Property Value
SupportAssociatedSecurity
public bool SupportAssociatedSecurity { get; set; }
Property Value
SupportBasketSecurities
public bool SupportBasketSecurities { get; set; }
Property Value
SupportFilteredMarketDepth
public bool SupportFilteredMarketDepth { get; set; }
Property Value
SupportLevel1DepthBuilder
[Obsolete("Use IMessageAdapter.GenerateOrderBookFromLevel1 property.")]
public bool SupportLevel1DepthBuilder { get; set; }
Property Value
SupportSnapshots
public virtual bool SupportSnapshots { get; set; }
Property Value
TimeChange
Increment periodically MarketTimeChangedInterval value of CurrentTime.
public bool TimeChange { get; set; }
Property Value
Trades
Get all tick trades.
[Obsolete("Use NewTrade event to collect data.")]
public IEnumerable<Trade> Trades { get; }
Property Value
TradesKeepCount
Number of tick trades for storage. The default is 100000. If the value is set to MaxValue, the trades will not be deleted. If the value is set to 0, then the trades will not be stored.
[Obsolete("Do nothing.")]
public int TradesKeepCount { get; set; }
Property Value
TransactionAdapter
Transactional adapter.
public IMessageAdapter TransactionAdapter { get; }
Property Value
TransactionIdGenerator
Transaction id generator.
public IdGenerator TransactionIdGenerator { get; set; }
Property Value
- IdGenerator
UpdateSecurityByDefinition
To update Security fields when the SecurityMessage message appears. By default is enabled.
public bool UpdateSecurityByDefinition { get; set; }
Property Value
UpdateSecurityByLevel1
To update Security fields when the Level1ChangeMessage message appears. By default is enabled.
public bool UpdateSecurityByLevel1 { get; set; }
Property Value
UpdateSecurityLastQuotes
To update LastTick, BestBid, BestAsk at each update of order book and/or trades. By default is enabled.
public bool UpdateSecurityLastQuotes { get; set; }
Property Value
Methods
CancelOrder(Order)
Cancel the order.
public void CancelOrder(Order order)
Parameters
order
OrderThe order which should be canceled.
CancelOrders(bool?, Portfolio, Sides?, ExchangeBoard, Security, SecurityTypes?, long?)
Cancel orders by filter.
public void CancelOrders(bool? isStopOrder = null, Portfolio portfolio = null, Sides? direction = null, ExchangeBoard board = null, Security security = null, SecurityTypes? securityType = null, long? transactionId = null)
Parameters
isStopOrder
bool?true, if cancel only a stop orders, false - if regular orders, null - both.
portfolio
PortfolioPortfolio. If the value is equal to null, then the portfolio does not match the orders cancel filter.
direction
Sides?Order side. If the value is null, the direction does not use.
board
ExchangeBoardTrading board. If the value is equal to null, then the board does not match the orders cancel filter.
security
SecurityInstrument. If the value is equal to null, then the instrument does not match the orders cancel filter.
securityType
SecurityTypes?Security type. If the value is null, the type does not use.
transactionId
long?Order cancellation transaction id.
ChangePassword(SecureString)
Change password.
public void ChangePassword(SecureString newPassword)
Parameters
newPassword
SecureStringNew password.
ClearCache()
Clear cache.
public virtual void ClearCache()
Connect()
Connect to trading system.
public void Connect()
CreateSecurityId(string, string)
Generate Id security.
protected string CreateSecurityId(string secCode, string boardCode)
Parameters
Returns
Disconnect()
Disconnect from trading system.
public void Disconnect()
DisposeManaged()
To release allocated resources. In particular, to disconnect from the trading system via Disconnect().
protected override void DisposeManaged()
EditOrder(Order, Order)
Edit the order.
public void EditOrder(Order order, Order changes)
Parameters
FindSubscriptions(Security, DataType)
Find subscriptions for the specified security and data type.
public IEnumerable<Subscription> FindSubscriptions(Security security, DataType dataType)
Parameters
Returns
- IEnumerable<Subscription>
Subscriptions.
GetLevel1Fields(Security)
To get a set of available fields Level1Fields, for which there is a market data for the instrument.
public IEnumerable<Level1Fields> GetLevel1Fields(Security security)
Parameters
security
SecuritySecurity.
Returns
- IEnumerable<Level1Fields>
Possible fields.
GetPortfolio(string)
To get the portfolio by the code name.
public Portfolio GetPortfolio(string name)
Parameters
name
stringPortfolio code name.
Returns
GetPosition(Portfolio, Security, string, Sides?, string, string, TPlusLimits?)
To get the position by portfolio and instrument.
public Position GetPosition(Portfolio portfolio, Security security, string strategyId = "", Sides? side = null, string clientCode = "", string depoName = "", TPlusLimits? limitType = null)
Parameters
portfolio
PortfolioThe portfolio on which the position should be found.
security
SecurityThe instrument on which the position should be found.
strategyId
stringStrategy ID.
side
Sides?Side.
clientCode
stringThe client code.
depoName
stringThe depository name where the stock is located physically. By default, an empty string is passed, which means the total position by all depositories.
limitType
TPlusLimits?Limit type for Т+ market.
Returns
- Position
Position.
GetSecurity(SecurityId)
Get security by identifier.
public Security GetSecurity(SecurityId securityId)
Parameters
securityId
SecurityIdSecurity ID.
Returns
- Security
Security.
GetSecurityId(Security)
Get SecurityId.
public SecurityId GetSecurityId(Security security)
Parameters
security
SecuritySecurity.
Returns
- SecurityId
Security ID.
GetSecurityValue(Security, Level1Fields)
To get the value of market data for the instrument.
public object GetSecurityValue(Security security, Level1Fields field)
Parameters
security
SecuritySecurity.
field
Level1FieldsMarket-data field.
Returns
GetSessionState(ExchangeBoard)
Get session state for required board.
public 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.
IsOrderEditable(Order)
Determines the specified order can be edited by EditOrder(Order, Order).
public bool? IsOrderEditable(Order order)
Parameters
order
OrderOrder.
Returns
IsOrderReplaceable(Order)
Determines the specified order can be replaced by ReRegisterOrder(Order, Order).
public bool? IsOrderReplaceable(Order order)
Parameters
order
OrderOrder.
Returns
Load(SettingsStorage)
Load settings.
public override void Load(SettingsStorage storage)
Parameters
storage
SettingsStorageSettings storage.
LookupById(SecurityId)
To get the instrument by the identifier.
public Security LookupById(SecurityId id)
Parameters
id
SecurityIdSecurity ID.
Returns
LookupByPortfolioName(string)
To get the portfolio by the code name.
public Portfolio LookupByPortfolioName(string name)
Parameters
name
stringPortfolio code name.
Returns
OnCancelOrder(Order, long)
Cancel the order.
protected void OnCancelOrder(Order order, long transactionId)
Parameters
OnCancelOrders(long, bool?, Portfolio, Sides?, ExchangeBoard, Security, SecurityTypes?)
Cancel orders by filter.
protected void OnCancelOrders(long transactionId, bool? isStopOrder = null, Portfolio portfolio = null, Sides? direction = null, ExchangeBoard board = null, Security security = null, SecurityTypes? securityType = null)
Parameters
transactionId
longOrder cancellation transaction id.
isStopOrder
bool?true, if cancel only a stop orders, false - if regular orders, null - both.
portfolio
PortfolioPortfolio. If the value is equal to null, then the portfolio does not match the orders cancel filter.
direction
Sides?Order side. If the value is null, the direction does not use.
board
ExchangeBoardTrading board. If the value is equal to null, then the board does not match the orders cancel filter.
security
SecurityInstrument. If the value is equal to null, then the instrument does not match the orders cancel filter.
securityType
SecurityTypes?Security type. If the value is null, the type does not use.
OnConnect()
Connect to trading system.
protected virtual void OnConnect()
OnDisconnect()
Disconnect from trading system.
protected virtual void OnDisconnect()
OnEditOrder(Order, Order)
Edit the order.
protected void OnEditOrder(Order order, Order changes)
Parameters
OnProcessMessage(Message)
Process message.
protected virtual void OnProcessMessage(Message message)
Parameters
message
MessageMessage.
OnReRegisterOrder(Order, Order)
Reregister the order.
protected void OnReRegisterOrder(Order oldOrder, Order newOrder)
Parameters
OnRegisterOrder(Order)
Register new order.
protected void OnRegisterOrder(Order order)
Parameters
order
OrderRegistration details.
RaiseError(Exception)
To call the event Error.
protected void RaiseError(Exception exception)
Parameters
exception
ExceptionData processing error.
RaiseSubscriptionFailed(Subscription, Exception, bool)
protected virtual void RaiseSubscriptionFailed(Subscription subscription, Exception error, bool isSubscribe)
Parameters
subscription
Subscriptionerror
ExceptionisSubscribe
bool
ReRegisterOrder(Order, Order)
Reregister the order.
public void ReRegisterOrder(Order oldOrder, Order newOrder)
Parameters
ReRegisterOrderPair(Order, Order, Order, Order)
Replace orders.
[Obsolete("Use ReRegisterOrder method.")]
public void ReRegisterOrderPair(Order oldOrder1, Order newOrder1, Order oldOrder2, Order newOrder2)
Parameters
oldOrder1
OrderCancelling order.
newOrder1
OrderNew order to register.
oldOrder2
OrderCancelling order.
newOrder2
OrderNew order to register.
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 Subscribe method instead.")]
public 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.")]
public void RegisterNews(Security security = null, IMessageAdapter adapter = null)
Parameters
security
SecuritySecurity for subscription.
adapter
IMessageAdapterTarget adapter. Can be null.
RegisterOrder(Order)
Register new order.
public void RegisterOrder(Order order)
Parameters
order
OrderRegistration details.
RegisterOrderLog(Security, DateTimeOffset?, DateTimeOffset?, long?, IMessageAdapter)
Subscribe on order log for the security.
[Obsolete("Use SubscribeOrderLog method instead.")]
public 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.
RegisterPortfolio(Portfolio)
Subscribe on the portfolio changes.
public void RegisterPortfolio(Portfolio portfolio)
Parameters
portfolio
PortfolioPortfolio for subscription.
RegisterSecurity(Security, DateTimeOffset?, DateTimeOffset?, long?, MarketDataBuildModes, DataType, IMessageAdapter)
[Obsolete("Use Subscribe method instead.")]
public 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.")]
public 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.
RequestNewsStory(News, IMessageAdapter)
Request news Story body. After receiving the event NewsChanged will be triggered.
public void RequestNewsStory(News news, IMessageAdapter adapter = null)
Parameters
news
NewsNews.
adapter
IMessageAdapterTarget adapter. Can be null.
Save(SettingsStorage)
Save settings.
public override void Save(SettingsStorage storage)
Parameters
storage
SettingsStorageSettings storage.
SendInMessage(Message)
Send message.
public bool SendInMessage(Message message)
Parameters
message
MessageMessage.
Returns
SendOutError(Exception)
Send error message.
public void SendOutError(Exception error)
Parameters
error
ExceptionError details.
SendOutMessage(Message)
Send outgoing message.
public void SendOutMessage(Message message)
Parameters
message
MessageMessage.
Subscribe(Subscription)
Subscribe.
public void Subscribe(Subscription subscription)
Parameters
subscription
SubscriptionSubscription.
TryGetSubscriptionById(long)
Try get subscription by id.
public Subscription TryGetSubscriptionById(long subscriptionId)
Parameters
subscriptionId
longSubscription id.
Returns
- Subscription
Subscription.
UnRegisterMarketDepth(Security)
To stop getting quotes by the instrument.
[Obsolete("Use UnSubscribeMarketDepth method instead.")]
public 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.")]
public void UnRegisterNews(Security security = null)
Parameters
security
SecuritySecurity for subscription.
UnRegisterOrderLog(Security)
Unsubscribe from order log for the security.
[Obsolete("Use UnSubscribeOrderLog method instead.")]
public void UnRegisterOrderLog(Security security)
Parameters
security
SecuritySecurity for unsubscription.
UnRegisterPortfolio(Portfolio)
Unsubscribe from the portfolio changes.
public void UnRegisterPortfolio(Portfolio portfolio)
Parameters
portfolio
PortfolioPortfolio for unsubscription.
UnRegisterSecurity(Security)
To stop getting new information.
[Obsolete("Use UnSubscribe method instead.")]
public 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.")]
public void UnRegisterTrades(Security security)
Parameters
security
SecurityThe instrument by which trades getting should be stopped.
UnSubscribe(Subscription)
Unsubscribe.
public void UnSubscribe(Subscription subscription)
Parameters
subscription
SubscriptionSubscription.
Events
BoardReceived
Board received.
public event Action<Subscription, ExchangeBoard> BoardReceived
Event Type
CandleProcessing
A new value for processing occurrence event.
public event Action<CandleSeries, ICandleMessage> CandleProcessing
Event Type
CandleReceived
Candle received.
public event Action<Subscription, ICandleMessage> CandleReceived
Event Type
CandleSeriesError
The series error event.
public event Action<CandleSeries, SubscriptionResponseMessage> CandleSeriesError
Event Type
CandleSeriesProcessing
A new value for processing occurrence event.
[Obsolete("Use CandleProcessing event.")]
public event Action<CandleSeries, Candle> CandleSeriesProcessing
Event Type
CandleSeriesStopped
The series processing end event.
public event Action<CandleSeries> CandleSeriesStopped
Event Type
ChangePasswordResult
Change password result.
public event Action<long, Exception> ChangePasswordResult
Event Type
Connected
Connected.
public event Action Connected
Event Type
ConnectedEx
Connected.
public event Action<IMessageAdapter> ConnectedEx
Event Type
ConnectionError
Connection error (for example, the connection was aborted by server).
public event Action<Exception> ConnectionError
Event Type
ConnectionErrorEx
Connection error (for example, the connection was aborted by server).
public event Action<IMessageAdapter, Exception> ConnectionErrorEx
Event Type
ConnectionLost
Connection lost.
public event Action<IMessageAdapter> ConnectionLost
Event Type
ConnectionRestored
Connection restored.
public event Action<IMessageAdapter> ConnectionRestored
Event Type
Disconnected
Disconnected.
public event Action Disconnected
Event Type
DisconnectedEx
Disconnected.
public event Action<IMessageAdapter> DisconnectedEx
Event Type
Error
The main interface providing the connection to the trading systems.
public event Action<Exception> Error
Event Type
Level1Received
Level1 received.
public event Action<Subscription, Level1ChangeMessage> Level1Received
Event Type
LookupBoardsResult
Lookup result BoardLookupMessage received.
public event Action<BoardLookupMessage, IEnumerable<ExchangeBoard>, Exception> LookupBoardsResult
Event Type
LookupBoardsResult2
Lookup result BoardLookupMessage received.
public event Action<BoardLookupMessage, IEnumerable<ExchangeBoard>, IEnumerable<ExchangeBoard>, Exception> LookupBoardsResult2
Event Type
LookupPortfoliosResult
Lookup result PortfolioLookupMessage received.
public event Action<PortfolioLookupMessage, IEnumerable<Portfolio>, Exception> LookupPortfoliosResult
Event Type
LookupPortfoliosResult2
Lookup result PortfolioLookupMessage received.
public event Action<PortfolioLookupMessage, IEnumerable<Portfolio>, IEnumerable<Portfolio>, Exception> LookupPortfoliosResult2
Event Type
LookupSecuritiesResult
Lookup result SecurityLookupMessage received.
public event Action<SecurityLookupMessage, IEnumerable<Security>, Exception> LookupSecuritiesResult
Event Type
LookupSecuritiesResult2
Lookup result SecurityLookupMessage received.
public event Action<SecurityLookupMessage, IEnumerable<Security>, IEnumerable<Security>, Exception> LookupSecuritiesResult2
Event Type
LookupTimeFramesResult
Lookup result TimeFrameLookupMessage received.
public event Action<TimeFrameLookupMessage, IEnumerable<TimeSpan>, Exception> LookupTimeFramesResult
Event Type
LookupTimeFramesResult2
Lookup result TimeFrameLookupMessage received.
public event Action<TimeFrameLookupMessage, IEnumerable<TimeSpan>, IEnumerable<TimeSpan>, Exception> LookupTimeFramesResult2
Event Type
MarketDataSubscriptionFailed
Error subscription market-data.
[Obsolete("Use SubscriptionFailed event.")]
public event Action<Security, MarketDataMessage, Exception> MarketDataSubscriptionFailed
Event Type
MarketDataSubscriptionFailed2
Error subscription market-data.
[Obsolete("Use SubscriptionFailed event.")]
public event Action<Security, MarketDataMessage, SubscriptionResponseMessage> MarketDataSubscriptionFailed2
Event Type
MarketDataSubscriptionFinished
Subscription market-data finished.
[Obsolete("Use SubscriptionStopped event.")]
public event Action<Security, SubscriptionFinishedMessage> MarketDataSubscriptionFinished
Event Type
MarketDataSubscriptionOnline
Subscription is online.
[Obsolete("Use SubscriptionOnline event.")]
public event Action<Security, MarketDataMessage> MarketDataSubscriptionOnline
Event Type
MarketDataSubscriptionSucceeded
Successful subscription market-data.
[Obsolete("Use SubscriptionStarted event.")]
public event Action<Security, MarketDataMessage> MarketDataSubscriptionSucceeded
Event Type
MarketDataUnSubscriptionFailed
Error unsubscription market-data.
[Obsolete("Use SubscriptionFailed event.")]
public event Action<Security, MarketDataMessage, Exception> MarketDataUnSubscriptionFailed
Event Type
MarketDataUnSubscriptionFailed2
Error unsubscription market-data.
[Obsolete("Use SubscriptionFailed event.")]
public event Action<Security, MarketDataMessage, SubscriptionResponseMessage> MarketDataUnSubscriptionFailed2
Event Type
MarketDataUnSubscriptionSucceeded
Successful unsubscription market-data.
[Obsolete("Use SubscriptionStopped event.")]
public event Action<Security, MarketDataMessage> MarketDataUnSubscriptionSucceeded
Event Type
MarketDataUnexpectedCancelled
Market-data subscription unexpected cancelled.
[Obsolete("Use SubscriptionFailed event.")]
public event Action<Security, MarketDataMessage, Exception> MarketDataUnexpectedCancelled
Event Type
MarketDepthChanged
Order book changed.
[Obsolete("Use OrderBookReceived event.")]
public event Action<MarketDepth> MarketDepthChanged
Event Type
MarketDepthReceived
Order book received.
[Obsolete("Use OrderBookReceived event.")]
public event Action<Subscription, MarketDepth> MarketDepthReceived
Event Type
MarketDepthsChanged
Order books changed.
[Obsolete("Use OrderBookReceived event.")]
public 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.
public event Action<TimeSpan> MarketTimeChanged
Event Type
MassOrderCancelFailed
Mass order cancellation errors event.
public event Action<long, Exception> MassOrderCancelFailed
Event Type
MassOrderCancelFailed2
Mass order cancellation errors event.
public event Action<long, Exception, DateTimeOffset> MassOrderCancelFailed2
Event Type
MassOrderCanceled
Mass order cancellation event.
public event Action<long> MassOrderCanceled
Event Type
MassOrderCanceled2
Mass order cancellation event.
public event Action<long, DateTimeOffset> MassOrderCanceled2
Event Type
NewMarketDepth
Order book received.
[Obsolete("Use OrderBookReceived event.")]
public event Action<MarketDepth> NewMarketDepth
Event Type
NewMarketDepths
Order books received.
[Obsolete("Use OrderBookReceived event.")]
public event Action<IEnumerable<MarketDepth>> NewMarketDepths
Event Type
NewMessage
Message processed Message.
public event Action<Message> NewMessage
Event Type
NewMyTrade
Own trade received.
public event Action<MyTrade> NewMyTrade
Event Type
NewMyTrades
Own trades received.
[Obsolete("Use NewMyTrade event.")]
public event Action<IEnumerable<MyTrade>> NewMyTrades
Event Type
NewNews
News received.
[Obsolete("Use NewsReceived event.")]
public event Action<News> NewNews
Event Type
NewOrder
Order received.
public event Action<Order> NewOrder
Event Type
NewOrderLogItem
Order log received.
[Obsolete("Use OrderLogReceived event.")]
public event Action<OrderLogItem> NewOrderLogItem
Event Type
NewOrderLogItems
Order log received.
[Obsolete("Use OrderLogReceived event.")]
public event Action<IEnumerable<OrderLogItem>> NewOrderLogItems
Event Type
NewOrders
Orders received.
[Obsolete("Use single item event overload.")]
public event Action<IEnumerable<Order>> NewOrders
Event Type
NewPortfolio
New portfolio received.
[Obsolete("Use PortfolioReceived event.")]
public event Action<Portfolio> NewPortfolio
Event Type
NewPortfolios
Portfolios received.
[Obsolete("Use PortfolioReceived event.")]
public event Action<IEnumerable<Portfolio>> NewPortfolios
Event Type
NewPosition
New position received.
[Obsolete("Use PositionReceived event.")]
public event Action<Position> NewPosition
Event Type
NewPositions
Positions received.
[Obsolete("Use PositionReceived event.")]
public event Action<IEnumerable<Position>> NewPositions
Event Type
NewSecurities
Securities received.
[Obsolete("Use SecurityReceived event.")]
public event Action<IEnumerable<Security>> NewSecurities
Event Type
NewSecurity
Security received.
[Obsolete("Use SecurityReceived event.")]
public event Action<Security> NewSecurity
Event Type
NewStopOrder
Stop-order received.
[Obsolete("Use NewOrder event.")]
public event Action<Order> NewStopOrder
Event Type
NewStopOrders
Stop-orders received.
[Obsolete("Use NewOrders event.")]
public event Action<IEnumerable<Order>> NewStopOrders
Event Type
NewTrade
Tick trade received.
[Obsolete("Use TickTradeReceived event.")]
public event Action<Trade> NewTrade
Event Type
NewTrades
Tick trades received.
[Obsolete("Use TickTradeReceived event.")]
public event Action<IEnumerable<Trade>> NewTrades
Event Type
NewsChanged
News updated (news body received Story).
[Obsolete("Use NewsReceived event.")]
public event Action<News> NewsChanged
Event Type
NewsReceived
News received.
public event Action<Subscription, News> NewsReceived
Event Type
OrderBookReceived
Order book received.
public event Action<Subscription, IOrderBookMessage> OrderBookReceived
Event Type
OrderCancelFailReceived
Order cancellation error event.
public event Action<Subscription, OrderFail> OrderCancelFailReceived
Event Type
OrderCancelFailed
Order cancellation error event.
public event Action<OrderFail> OrderCancelFailed
Event Type
OrderChanged
Order changed (cancelled, matched).
public event Action<Order> OrderChanged
Event Type
OrderEditFailReceived
Order edition error event.
public event Action<Subscription, OrderFail> OrderEditFailReceived
Event Type
OrderEditFailed
EditOrder(Order, Order) error result event.
public event Action<long, OrderFail> OrderEditFailed
Event Type
OrderEdited
EditOrder(Order, Order) success result event.
public event Action<long, Order> OrderEdited
Event Type
OrderLogItemReceived
Order log received.
[Obsolete("Use OrderLogReceived event.")]
public event Action<Subscription, OrderLogItem> OrderLogItemReceived
Event Type
OrderLogReceived
Tick trade received.
public event Action<Subscription, IOrderLogMessage> OrderLogReceived
Event Type
OrderReceived
Order received.
public event Action<Subscription, Order> OrderReceived
Event Type
OrderRegisterFailReceived
Order registration error event.
public event Action<Subscription, OrderFail> OrderRegisterFailReceived
Event Type
OrderRegisterFailed
Order registration error event.
public event Action<OrderFail> OrderRegisterFailed
Event Type
OrderStatusFailed
Failed order status request event.
[Obsolete("Use SubscriptionFailed event.")]
public event Action<long, Exception> OrderStatusFailed
Event Type
OrderStatusFailed2
Failed order status request event.
public event Action<long, Exception, DateTimeOffset> OrderStatusFailed2
Event Type
OrdersCancelFailed
Order cancellation errors event.
[Obsolete("Use single item event overload.")]
public event Action<IEnumerable<OrderFail>> OrdersCancelFailed
Event Type
OrdersChanged
Orders changed (cancelled, matched).
[Obsolete("Use single item event overload.")]
public event Action<IEnumerable<Order>> OrdersChanged
Event Type
OrdersRegisterFailed
Order registration errors event.
[Obsolete("Use single item event overload.")]
public event Action<IEnumerable<OrderFail>> OrdersRegisterFailed
Event Type
OwnTradeReceived
Own trade received.
public event Action<Subscription, MyTrade> OwnTradeReceived
Event Type
PortfolioChanged
Portfolio changed.
[Obsolete("Use PortfolioReceived event.")]
public event Action<Portfolio> PortfolioChanged
Event Type
PortfolioReceived
Portfolio received.
public event Action<Subscription, Portfolio> PortfolioReceived
Event Type
PortfoliosChanged
Portfolios changed.
[Obsolete("Use PortfolioReceived event.")]
public event Action<IEnumerable<Portfolio>> PortfoliosChanged
Event Type
PositionChanged
Position changed.
[Obsolete("Use PositionReceived event.")]
public event Action<Position> PositionChanged
Event Type
PositionReceived
Position received.
public event Action<Subscription, Position> PositionReceived
Event Type
PositionsChanged
Positions changed.
[Obsolete("Use PositionReceived event.")]
public event Action<IEnumerable<Position>> PositionsChanged
Event Type
Restored
Connection restored.
[Obsolete("Use ConnectionRestored event.")]
public event Action Restored
Event Type
SecuritiesChanged
Securities changed.
[Obsolete("Use SecurityReceived event.")]
public event Action<IEnumerable<Security>> SecuritiesChanged
Event Type
SecurityChanged
Security changed.
[Obsolete("Use SecurityReceived event.")]
public event Action<Security> SecurityChanged
Event Type
SecurityReceived
Security received.
public event Action<Subscription, Security> SecurityReceived
Event Type
SessionStateChanged
Session changed.
public event Action<ExchangeBoard, SessionStates> SessionStateChanged
Event Type
StopOrderCancelFailed
Stop-order cancellation error event.
[Obsolete("Use OrderCancelFailed event.")]
public event Action<OrderFail> StopOrderCancelFailed
Event Type
StopOrderChanged
Stop order state change event.
[Obsolete("Use OrderChanged event.")]
public event Action<Order> StopOrderChanged
Event Type
StopOrderRegisterFailed
Stop-order registration error event.
[Obsolete("Use OrderRegisterFailed event.")]
public event Action<OrderFail> StopOrderRegisterFailed
Event Type
StopOrdersCancelFailed
Stop-order cancellation errors event.
[Obsolete("Use OrdersCancelFailed event.")]
public event Action<IEnumerable<OrderFail>> StopOrdersCancelFailed
Event Type
StopOrdersChanged
Stop orders state change event.
[Obsolete("Use OrdersChanged event.")]
public event Action<IEnumerable<Order>> StopOrdersChanged
Event Type
StopOrdersRegisterFailed
Stop-order registration errors event.
[Obsolete("Use OrdersRegisterFailed event.")]
public event Action<IEnumerable<OrderFail>> StopOrdersRegisterFailed
Event Type
SubscriptionFailed
Subscription is failed.
public event Action<Subscription, Exception, bool> SubscriptionFailed
Event Type
SubscriptionOnline
Subscription is online.
public event Action<Subscription> SubscriptionOnline
Event Type
SubscriptionReceived
Message received.
public event Action<Subscription, object> SubscriptionReceived
Event Type
SubscriptionStarted
Subscription is started.
public event Action<Subscription> SubscriptionStarted
Event Type
SubscriptionStopped
Subscription is stopped.
public event Action<Subscription, Exception> SubscriptionStopped
Event Type
TickTradeReceived
Tick trade received.
public event Action<Subscription, ITickTradeMessage> TickTradeReceived
Event Type
TimeOut
Connection timed-out.
[Obsolete("Use ConnectionError event.")]
public event Action TimeOut
Event Type
ValuesChanged
Security changed.
public event Action<Security, IEnumerable<KeyValuePair<Level1Fields, object>>, DateTimeOffset, DateTimeOffset> ValuesChanged