Click or drag to resize

Connector Class

The class to create connections to trading systems.
Inheritance Hierarchy

Namespace:  StockSharp.Algo
Assembly:  StockSharp.Algo (in StockSharp.Algo.dll) Version: 4.3.27.2 (4.3.27.2)
Syntax
C#
public class Connector : BaseLogReceiver, IConnector, 
	IPersistable, ILogReceiver, ILogSource, IDisposable, IMarketDataProvider, 
	ISecurityProvider, INewsProvider, IPortfolioProvider

The Connector type exposes the following members.

Constructors
  NameDescription
Public methodConnector
Initializes a new instance of the Connector.
Protected methodConnector(Boolean, Boolean, Boolean, Boolean, Boolean)
Initializes a new instance of the Connector.
Public methodConnector(IEntityRegistry, IStorageRegistry, Boolean, Boolean, Boolean)
Initializes a new instance of the Connector.
Top
Properties
  NameDescription
Public propertyAdapter
Message adapter.
Public propertyAutoPortfoliosSubscribe
Send lookup messages on connect. By default is .
Public propertyCommissionManager
The commission calculating manager.
Public propertyConnectionState
Connection state.
Public propertyCreateAssociatedSecurity
Create a combined security for securities from different boards.
Public propertyCreateDepthFromLevel1
To update the order book for the instrument when the Level1ChangeMessage message appears. By default is enabled.
Public propertyCreateDepthFromOrdersLog
Use orders log to create market depths. Disabled by default.
Public propertyCreateTradesFromOrdersLog
Use orders log to create ticks. Disabled by default.
Public propertyCurrentTime
Current time, which will be passed to the Time.
(Overrides BaseLogSourceCurrentTime.)
Public propertyEntityFactory
Entity factory (Security, Order etc.).
Public propertyErrorCount
The number of errors passed through the Error event.
Public propertyExchangeBoards
List of all exchange boards, for which instruments are loaded Securities.
Public propertyId
The unique identifier of the source.
(Inherited from BaseLogSource.)
Public propertyInMessageChannel
Input message channel.
Public propertyInnerAdapter
Inner message adapter.
Public propertyIsDisposed (Inherited from Disposable.)
Public propertyIsRestorSubscriptioneOnReconnect
Restore subscription on reconnect.
Public propertyIsRoot
Whether the source is the root (even if Parent is not equal to ).
(Inherited from BaseLogSource.)
Public propertyLatencyManager
Orders registration delay calculation manager.
Public propertyLogLevel
The logging level. The default is set to Inherit.
(Inherited from BaseLogSource.)
Public propertyLookupMessagesOnConnect
Send lookup messages on connect. By default is .
Public propertyMarketDataAdapter
Market-data adapter.
Public propertyMarketTimeChangedInterval
The TimeMessage message generating Interval. The default is 10 milliseconds.
Public propertyMyTrades
Get all own trades.
Public propertyName
Source name (to distinguish in log files).
(Inherited from BaseLogSource.)
Public propertyNews
All news.
Public propertyOrderCancelFails
Get all cancellation errors.
Public propertyOrderRegisterFails
Get all registration errors.
Public propertyOrders
Get all orders.
Public propertyOrdersKeepCount
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 propertyOutMessageChannel
Outgoing message channel.
Public propertyParent
Parent.
(Inherited from BaseLogSource.)
Public propertyPnLManager
The profit-loss manager.
Public propertyPortfolios
Get all portfolios.
Public propertyPositions
Get all positions.
Protected propertyRaiseConnectedOnFirstAdapter
To call the Connected event when the first adapter connects to Adapter.
Public propertyReConnectionSettings
Settings of the connection control IConnector to the trading system.
Public propertyRegisteredMarketDepths
List of all securities, subscribed via RegisterMarketDepth(Security).
Public propertyRegisteredOrderLogs
List of all securities, subscribed via RegisterOrderLog(Security).
Public propertyRegisteredPortfolios
List of all portfolios, subscribed via RegisterPortfolio(Portfolio).
Public propertyRegisteredSecurities
List of all securities, subscribed via RegisterSecurity(Security).
Public propertyRegisteredTrades
List of all securities, subscribed via RegisterTrades(Security).
Public propertyRiskManager
Risk control manager.
Public propertySecurities
List of all loaded instruments. It should be called after event NewSecurities arisen. Otherwise the empty set will be returned.
Public propertySecurityIdGenerator
The instrument identifiers generator Id.
Public propertySlippageManager
Slippage manager.
Public propertyStopOrders
Get all stop-orders.
Public propertyStorageAdapter
Storage adapter.
Public propertySupportAssociatedSecurity
Public propertySupportCandleBuilder
Public propertySupportFilteredMarketDepth
Public propertySupportLevel1DepthBuilder
Public propertySupportOffline
Public propertySupportSubscriptionTracking
Public propertyTimeChange
Increment periodically MarketTimeChangedInterval value of CurrentTime.
Public propertyTrades
Get all tick trades.
Public propertyTradesKeepCount
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.
Public propertyTransactionAdapter
Transactional adapter.
Public propertyTransactionIdGenerator
Transaction id generator.
Public propertyUpdateSecurityByDefinition
To update Security fields when the SecurityMessage message appears. By default is enabled.
Public propertyUpdateSecurityByLevel1
To update Security fields when the Level1ChangeMessage message appears. By default is enabled.
Public propertyUpdateSecurityLastQuotes
To update LastTrade, BestBid, BestAsk at each update of order book and/or trades. By default is enabled.
Top
Methods
  NameDescription
Public methodCancelOrder
Cancel the order.
Public methodCancelOrders
Cancel orders by filter.
Public methodChangePassword
Change password.
Public methodClearCache
Clear cache.
Public methodConnect
Connect to trading system.
Protected methodCreateSecurityId
Generate Id security.
Public methodDisconnect
Disconnect from trading system.
Public methodDispose (Inherited from Disposable.)
Protected methodDisposeManaged
To release allocated resources. In particular, to disconnect from the trading system via Disconnect.
(Overrides Disposable.DisposeManaged.)
Protected methodDisposeNative (Inherited from Disposable.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize (Inherited from Disposable.)
Public methodGetFilteredMarketDepth
Get filtered order book.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetLevel1Fields
To get a set of available fields Level1Fields, for which there is a market data for the instrument.
Public methodGetMarketDepth
To get the quotes order book.
Public methodGetPosition
To get the position by portfolio and instrument.
Protected methodGetSecurity
Get security by code.
Public methodGetSecurityId
Get SecurityId.
Public methodGetSecurityValue
To get the value of market data for the instrument.
Public methodGetSessionState
Get session state for required board.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInitializeStorage
Initialize StorageAdapter.
Public methodLoad
Load settings.
(Overrides BaseLogSourceLoad(SettingsStorage).)
Public methodLookup
Lookup securities by criteria criteria.
Public methodLookupPortfolios
To find portfolios that match the filter criteria. Found portfolios will be passed through the event LookupPortfoliosResult.
Public methodLookupSecurities(Security)
To find instruments that match the filter criteria. Found instruments will be passed through the event LookupSecuritiesResult.
Public methodLookupSecurities(SecurityLookupMessage)
To find instruments that match the filter criteria. Found instruments will be passed through the event LookupSecuritiesResult.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnCancelOrder
Cancel the order.
Protected methodOnCancelOrders
Cancel orders by filter.
Protected methodOnConnect
Connect to trading system.
Protected methodOnDisconnect
Disconnect from trading system.
Protected methodOnProcessMessage
Process message.
Protected methodOnRegisterNews
Subscribe on news.
Protected methodOnRegisterOrder
Register new order.
Protected methodOnRegisterPortfolio
Subscribe on the portfolio changes.
Protected methodOnReRegisterOrder
Reregister the order.
Protected methodOnReRegisterOrderPair
Reregister of pair orders.
Protected methodOnUnRegisterNews
Unsubscribe from news.
Protected methodOnUnRegisterPortfolio
Unsubscribe from the portfolio changes.
Protected methodRaiseError
To call the event Error.
Protected methodRaiseLog
To call the event Log.
(Inherited from BaseLogSource.)
Public methodRegisterFilteredMarketDepth
To start getting filtered quotes (order book) by the instrument. Quotes values are available through the event GetFilteredMarketDepth(Security).
Public methodRegisterMarketDepth
To start getting quotes (order book) by the instrument. Quotes values are available through the event MarketDepthsChanged.
Public methodRegisterNews
Subscribe on news.
Public methodRegisterOrder
Register new order.
Public methodRegisterOrderLog
Subscribe on order log for the security.
Public methodRegisterPortfolio
Subscribe on the portfolio changes.
Public methodRegisterSecurity
To start getting new information (for example, LastTrade or BestBid) by the instrument.
Public methodRegisterTrades
To start getting trades (tick data) by the instrument. New trades will come through the event NewTrades.
Public methodRequestNewsStory
Request news Story body. After receiving the event NewsChanged will be triggered.
Public methodReRegisterOrder(Order, Order)
Reregister the order.
Public methodReRegisterOrder(Order, Decimal, Decimal)
Reregister the order.
Public methodReRegisterOrderPair
Reregister of pair orders.
Public methodSave
Save settings.
(Overrides BaseLogSourceSave(SettingsStorage).)
Public methodSendInMessage
Send message.
Public methodSendOutError
Send error message.
Public methodSendOutMessage
Send outgoing message.
Public methodSubscribeCandles
Subscribe to receive new candles.
Public methodSubscribeMarketData
To sign up to get market data by the instrument.
Protected methodThrowIfDisposed (Inherited from Disposable.)
Public methodToString
Returns a string that represents the current object.
(Inherited from BaseLogSource.)
Public methodUnRegisterFilteredMarketDepth
To stop getting filtered quotes by the instrument.
Public methodUnRegisterMarketDepth
To stop getting quotes by the instrument.
Public methodUnRegisterNews
Unsubscribe from news.
Public methodUnRegisterOrderLog
Unsubscribe from order log for the security.
Public methodUnRegisterPortfolio
Unsubscribe from the portfolio changes.
Public methodUnRegisterSecurity
To stop getting new information.
Public methodUnRegisterTrades
To stop getting trades (tick data) by the instrument.
Public methodUnSubscribeCandles
Public methodUnSubscribeMarketData
To unsubscribe from getting market data by the instrument.
Top
Events
  NameDescription
Public eventCandleSeriesProcessing
A new value for processing occurrence event.
Public eventCandleSeriesStopped
The series processing end event.
Public eventConnected
Connected.
Public eventConnectedEx
Connected.
Public eventConnectionError
Connection error (for example, the connection was aborted by server).
Public eventConnectionErrorEx
Connection error (for example, the connection was aborted by server).
Public eventDisconnected
Disconnected.
Public eventDisconnectedEx
Disconnected.
Public eventError
Data process error.
Public eventLog
New debug message event.
(Inherited from BaseLogSource.)
Public eventLookupPortfoliosResult
Lookup result LookupPortfolios(Portfolio) received.
Public eventLookupSecuritiesResult
Lookup result LookupSecurities(Security) received.
Public eventMarketDataSubscriptionFailed
Error subscription market-data.
Public eventMarketDataSubscriptionSucceeded
Successful subscription market-data.
Public eventMarketDataUnSubscriptionFailed
Error unsubscription market-data.
Public eventMarketDataUnSubscriptionSucceeded
Successful unsubscription market-data.
Public eventMarketDepthChanged
Order book changed.
Public eventMarketDepthsChanged
Order books changed.
Public eventMarketTimeChanged
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 eventMassOrderCanceled
Mass order cancellation event.
Public eventMassOrderCancelFailed
Mass order cancellation errors event.
Public eventNewMarketDepth
Order book received.
Public eventNewMarketDepths
Order books received.
Public eventNewMessage
Message processed Message.
Public eventNewMyTrade
Own trade received.
Public eventNewMyTrades
Own trades received.
Public eventNewNews
News received.
Public eventNewOrder
Order received.
Public eventNewOrderLogItem
Order log received.
Public eventNewOrderLogItems
Order log received.
Public eventNewOrders
Orders received.
Public eventNewPortfolio
New portfolio received.
Public eventNewPortfolios
Portfolios received.
Public eventNewPosition
Position received.
Public eventNewPositions
Positions received.
Public eventNewsChanged
News updated (news body received Story).
Public eventNewSecurities
Securities received.
Public eventNewSecurity
Security received.
Public eventNewStopOrder
Stop-order received.
Public eventNewStopOrders
Stop-orders received.
Public eventNewTrade
Tick trade received.
Public eventNewTrades
Tick trades received.
Public eventOrderCancelFailed
Order cancellation error event.
Public eventOrderChanged
Order changed (cancelled, matched).
Public eventOrderRegisterFailed
Order registration error event.
Public eventOrdersCancelFailed
Order cancellation errors event.
Public eventOrdersChanged
Orders changed (cancelled, matched).
Public eventOrdersRegisterFailed
Order registration errors event.
Public eventOrderStatusFailed
Failed order status request event.
Public eventPortfolioChanged
Portfolio changed.
Public eventPortfoliosChanged
Portfolios changed.
Public eventPositionChanged
Position changed.
Public eventPositionsChanged
Positions changed.
Public eventRestored
Connection restored.
Public eventSecuritiesChanged
Securities changed.
Public eventSecurityChanged
Security changed.
Public eventSessionStateChanged
Session changed.
Public eventStopOrderCancelFailed
Stop-order cancellation error event.
Public eventStopOrderChanged
Stop order state change event.
Public eventStopOrderRegisterFailed
Stop-order registration error event.
Public eventStopOrdersCancelFailed
Stop-order cancellation errors event.
Public eventStopOrdersChanged
Stop-orders changed.
Public eventStopOrdersRegisterFailed
Stop-order registration errors event.
Public eventTimeOut
Connection timed-out.
Public eventValuesChanged
Security changed.
Top
Extension Methods
  NameDescription
Public Extension MethodAddDebugLog
To record a debug message to the log.
(Defined by LoggingHelper.)
Public Extension MethodAddErrorLog(FuncString)Overloaded.
To record an error to the log.
(Defined by LoggingHelper.)
Public Extension MethodAddErrorLog(Exception)Overloaded.
To record an error to the log.
(Defined by LoggingHelper.)
Public Extension MethodAddErrorLog(Exception, String)Overloaded.
To record an error to the log.
(Defined by LoggingHelper.)
Public Extension MethodAddErrorLog(String, Object)Overloaded.
To record an error to the log.
(Defined by LoggingHelper.)
Public Extension MethodAddInfoLog(FuncString)Overloaded.
To record a message to the log.
(Defined by LoggingHelper.)
Public Extension MethodAddInfoLog(String, Object)Overloaded.
To record a message to the log.
(Defined by LoggingHelper.)
Public Extension MethodAddLog
To record a message to the log.
(Defined by LoggingHelper.)
Public Extension MethodAddOrderErrorLog
Write order error to the log.
(Defined by TraderHelper.)
Public Extension MethodAddOrderInfoLog
Write order info to the log.
(Defined by TraderHelper.)
Public Extension MethodAddVerboseLog
To record a verbose message to the log.
(Defined by LoggingHelper.)
Public Extension MethodAddWarningLog(FuncString)Overloaded.
To record a warning to the log.
(Defined by LoggingHelper.)
Public Extension MethodAddWarningLog(String, Object)Overloaded.
To record a warning to the log.
(Defined by LoggingHelper.)
Public Extension MethodCancelOrders
Cancel orders by filter.
(Defined by TraderHelper.)
Public Extension MethodConfigure
Configure connection using ConnectorWindow.
(Defined by Extensions.)
Public Extension MethodFilterSecurities
To filter Securities by given criteria.
(Defined by TraderHelper.)
Public Extension MethodGetAllSecurity
Find AllSecurity instance in the specified provider.
(Defined by TraderHelper.)
Public Extension MethodGetLogLevel
Get LogLevel for the source. If the value is equal to Inherit, then parental source level is taken.
(Defined by LoggingHelper.)
Public Extension MethodGetSecurityCriteria
To create the search criteria Security from SecurityLookupMessage.
(Defined by TraderHelper.)
Public Extension MethodGetSecurityValueT
To get the value of market data for the instrument.
(Defined by TraderHelper.)
Public Extension MethodGetSecurityValues
To get all market data values for the instrument.
(Defined by TraderHelper.)
Public Extension MethodLookupAll
Get all available instruments.
(Defined by TraderHelper.)
Public Extension MethodLookupByCode
To get the instrument by the instrument code.
(Defined by TraderHelper.)
Public Extension MethodLookupById(String)Overloaded.
To get the instrument by the identifier.
(Defined by TraderHelper.)
Public Extension MethodLookupById(SecurityId)Overloaded.
To get the instrument by the identifier.
(Defined by TraderHelper.)
Public Extension MethodLookupByNativeId
To get the instrument by the system identifier.
(Defined by TraderHelper.)
Public Extension MethodLookupByPortfolioName
To get the portfolio by the code name.
(Defined by TraderHelper.)
Public Extension MethodWhenIntervalElapsed
To create a rule for the event MarketTimeChanged, activated after expiration of interval.
(Defined by MarketRuleHelper.)
Public Extension MethodWhenNewMyTrade
To create a rule for the event of new trade occurrences.
(Defined by MarketRuleHelper.)
Public Extension MethodWhenNewOrder
To create a rule for the event of new orders occurrences.
(Defined by MarketRuleHelper.)
Public Extension MethodWhenTimeCome(DateTimeOffset)Overloaded.
To create a rule, activated at the exact time, specified through times.
(Defined by MarketRuleHelper.)
Public Extension MethodWhenTimeCome(IEnumerableDateTimeOffset)Overloaded.
To create a rule, activated at the exact time, specified through times.
(Defined by MarketRuleHelper.)
Top
See Also
Inheritance Hierarchy
SystemObject
  Disposable
    StockSharp.LoggingBaseLogSource
      StockSharp.LoggingBaseLogReceiver
        StockSharp.AlgoConnector
          StockSharp.Algo.TestingBaseEmulationConnector
          StockSharp.BitStampBitStampTrader
          StockSharp.BlackwoodBlackwoodTrader
          StockSharp.BtceBtceTrader
          StockSharp.Cqg.ComCqgComTrader
          StockSharp.Cqg.ContinuumCqgContinuumTrader
          StockSharp.ETradeETradeTrader
          StockSharp.FixFixTrader
          StockSharp.FxcmFxcmTrader
          StockSharp.InteractiveBrokersInteractiveBrokersTrader
          StockSharp.IQFeedIQFeedTrader
          StockSharp.ITCHItchTrader
          StockSharp.LMAXLmaxTrader
          StockSharp.OandaOandaTrader
          StockSharp.OpenECryOpenECryTrader
          StockSharp.QuantHouseQuantFeedTrader
          StockSharp.RithmicRithmicTrader
          StockSharp.RssRssTrader
          StockSharp.SterlingSterlingTrader