Class Handler
Provides access to the CME Group market data via SBE protocols.
Inheritance
Namespace: OnixS.CmeMdHandler
Assembly: OnixS.CmeMdHandler.dll
Syntax
public class Handler : IDisposable
Constructors
Handler(String)
Constructor.
Declaration
public Handler(string channelId)
Parameters
Type | Name | Description |
---|---|---|
System.String | channelId | CME Market Data Feed Channel ID. |
Properties
BestBidOfferTrackingOptions
Describes parameters and thresholds which will be used to track best bids and best asks.
Declaration
public BestBidOfferTrackingOptions BestBidOfferTrackingOptions { get; }
Property Value
Type | Description |
---|---|
BestBidOfferTrackingOptions |
BookUpdatedCallbackPolicy
Gets book updated callbacks policy.
Declaration
public BookUpdatedCallbackPolicy BookUpdatedCallbackPolicy { get; set; }
Property Value
Type | Description |
---|---|
BookUpdatedCallbackPolicy |
ChannelConfigurationFile
Path to the CME Market Data Feed Channel configuration XML file.
Declaration
public string ChannelConfigurationFile { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ChannelId
CME Market Data Feed Channel ID.
Declaration
public string ChannelId { get; }
Property Value
Type | Description |
---|---|
System.String |
DecoderLibraryPath
Path to generated decoder library assembly.
Declaration
public string DecoderLibraryPath { get; set; }
Property Value
Type | Description |
---|---|
System.String |
DecoderTypeFullName
Get or set the name of the decoder class which will be used when LoadDecoderLibrary is true.
Declaration
public string DecoderTypeFullName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
DirectBookDefaultDepth
Get or set default depth for direct book.
Declaration
public int DirectBookDefaultDepth { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
FixMessagesLogger
Logger to control fix message processing related tracing and debug output.
Declaration
public static NLog.Logger FixMessagesLogger { get; }
Property Value
Type | Description |
---|---|
NLog.Logger |
HandlerLogger
Logger to control Handler related tracing and debug output.
Declaration
public static NLog.Logger HandlerLogger { get; }
Property Value
Type | Description |
---|---|
NLog.Logger |
ImpliedBookDefaultDepth
Get or set default depth for implied book.
Declaration
public int ImpliedBookDefaultDepth { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
LicenseExpirationDate
Gets license expiration date.
Declaration
public DateTime LicenseExpirationDate { get; }
Property Value
Type | Description |
---|---|
DateTime |
LicensePath
Path to the directory where license file located.
Declaration
public static string LicensePath { get; set; }
Property Value
Type | Description |
---|---|
System.String |
LoadDecoderLibrary
Get or set if the handler should load existing decoding library or create a new one. DecoderTypeFullName property will specify decoder type full name.
Declaration
public bool LoadDecoderLibrary { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
LocalNetworkInterface
The local network interface that is used to receive UDP multicast packets.
Declaration
public IPAddress LocalNetworkInterface { get; set; }
Property Value
Type | Description |
---|---|
IPAddress |
Remarks
If set to null then all available local network interfaces are used.
LocalNetworkInterfaceA
The local network interface that is used to receive UDP multicast packets for "A" feeds.
Declaration
public System.Net.IPAddress LocalNetworkInterfaceA { get; set; }
Property Value
Type | Description |
---|---|
System.Net.IPAddress |
Remarks
If set to null then the LocalNetworkInterface value is used.
LocalNetworkInterfaceB
The local network interface that is used to receive UDP multicast packets for "B" feeds.
Declaration
public System.Net.IPAddress LocalNetworkInterfaceB { get; set; }
Property Value
Type | Description |
---|---|
System.Net.IPAddress |
Remarks
If set to null then the LocalNetworkInterface value is used.
MaximumNumberOfQueuedIncrementalRefreshMessages
Maximum number of queued Market Data Incremental Refresh (X) messages.
Declaration
public static int MaximumNumberOfQueuedIncrementalRefreshMessages { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
When the message gap is detected all subsequent Refresh(X) messages are queued until the Handler re-synchronizes with the market using Snapshot(W) messages. After that the queued Refresh(X) messages are re-played. This setting could be used to limit the memory usage when there is no Market Data - Snapshot/Full Refresh (W) messages.
MaximumOutOfOrderIncrementalQueueSize
Get or set maximum incremental packets cache size. This cache are used for packet alignment. Default value is 5.
Declaration
public int MaximumOutOfOrderIncrementalQueueSize { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
NumberOfQueuedIncrementalRefreshMessages
Gets count of queued incremental refresh messages.
Declaration
public int NumberOfQueuedIncrementalRefreshMessages { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
OrderBookLogger
Logger to control order books related tracing and debug output.
Declaration
public static NLog.Logger OrderBookLogger { get; }
Property Value
Type | Description |
---|---|
NLog.Logger |
OutOfOrderIncrementalQueueSize
Gets count of incremental messages, cached in sorting cache.
Declaration
public int OutOfOrderIncrementalQueueSize { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
ReceiveBufferSize
Gets or sets size of receiving buffer in bytes. Increasing this buffer will decrease GC load. If value will be less or equal then 65536 bytes, then default system value of 65536 bytes will be used. Default value is 65536 * 10.
Declaration
public int ReceiveBufferSize { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
ReceiversLogger
Logger to control udp receivers related tracing and debug output.
Declaration
public static NLog.Logger ReceiversLogger { get; }
Property Value
Type | Description |
---|---|
NLog.Logger |
ReceiveSpinningTimeout
The non-blocking receive spinning timeout (in microseconds) before the receiving thread enters into the blocking wait mode. Default value is 0.
Declaration
public int ReceiveSpinningTimeout { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
ReceiveTimeoutInMilliseconds
Gets or sets the amount of time a Handler will wait to receive data once a read operation is initiated.
Declaration
public int ReceiveTimeoutInMilliseconds { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
ReceivingThreadAffinity
Get or set thread affinity of receiving thread. Default value is normal.
Declaration
public uint[] ReceivingThreadAffinity { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32[] |
ReceivingThreadPriority
Get or set thread priority of receiving thread. Default value is normal.
Declaration
public ThreadPriority ReceivingThreadPriority { get; set; }
Property Value
Type | Description |
---|---|
ThreadPriority |
RecoverSecurityDefinitionsOnGap
Option to recover the Security Definition messages each time when the message sequence gap is detected.
Declaration
public bool RecoverSecurityDefinitionsOnGap { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Option to recover the Security Definition messages each time when the message sequence gap is detected.
During the trading day new instruments can be defined, and these security definitions are sent over the Incremental A and B feeds. Therefore it is possible to miss new intra-day security definition messages, so it could be required to listen to the instrument feed again on a message gap.
On the other hand, this could significantly increase the time of re-syncronization with the market after the detected message gap.
The default value is false.
ReportNoDataWarning
Gets or Set the flag to suppress OnWarning events for "NO DATA in Incremental A/B UdpReceiver during ReceiveTimeoutInMilliseconds"
Declaration
public bool ReportNoDataWarning { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
SbeTemplatesFile
Path to the CME SBE templates file.
Declaration
public string SbeTemplatesFile { get; set; }
Property Value
Type | Description |
---|---|
System.String |
SecurityDefinitionsCacheRoot
Gets or Sets path where Security Definitions cache will be stored.
Declaration
public string SecurityDefinitionsCacheRoot { get; set; }
Property Value
Type | Description |
---|---|
System.String |
SecurityGroupFilters
Gets Security Group filtering values.
Declaration
public ICollection<string> SecurityGroupFilters { get; }
Property Value
Type | Description |
---|---|
ICollection<System.String> |
SecurityIdFilters
Gets Security ID filtering values.
Declaration
public ICollection<string> SecurityIdFilters { get; }
Property Value
Type | Description |
---|---|
ICollection<System.String> |
State
Handler's state.
Declaration
public HandlerState State { get; }
Property Value
Type | Description |
---|---|
HandlerState |
SymbolFilters
Gets Symbol filtering values.
Declaration
public ICollection<string> SymbolFilters { get; }
Property Value
Type | Description |
---|---|
ICollection<System.String> |
TcpReplay
Option to use the TcpReplay Channel for recovory of missed messages.
Declaration
public bool TcpReplay { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
This method recovers all missed messages.
TcpReplayPassword
Password or passphrase to be used in the Logon (35=A) message from customer to CME Tcp Replay service.
Declaration
public string TcpReplayPassword { get; set; }
Property Value
Type | Description |
---|---|
System.String |
TcpReplayReconnectAttempts
Number of attempts to receive missed messages via CME Tcp Replay service.
Declaration
public int TcpReplayReconnectAttempts { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
TcpReplayReconnectIntervalInMilliseconds
Interval between attempts to receive missed messages via CME Tcp Replay service (in milliseconds).
Declaration
public int TcpReplayReconnectIntervalInMilliseconds { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
TcpReplayUsername
Userid or username to be used in the Logon (35=A) message from customer to CME Tcp Replay service.
Declaration
public string TcpReplayUsername { get; set; }
Property Value
Type | Description |
---|---|
System.String |
UdpSocketBufferSize
Gets or sets socket receive buffer size in bytes. Default value is 4194304 = 4MB.
Declaration
public int UdpSocketBufferSize { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
UseIncrementalFeedA
Gets or Set the flag to use or not Incremental (UDP) Feed A
Declaration
public bool UseIncrementalFeedA { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
UseIncrementalFeedB
Gets or Set the flag to use or not Incremental (UDP) Feed B
Declaration
public bool UseIncrementalFeedB { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
UseInstrumentReplayFeedA
Gets or Set the flag to use or not Instrument Definition (UDP) Feed A
Declaration
public bool UseInstrumentReplayFeedA { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
UseInstrumentReplayFeedB
Gets or sets the flag to use or not Instrument Definition (UDP) Feed B
Declaration
public bool UseInstrumentReplayFeedB { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
UseSnapshotFeedA
Gets or Set the flag to use or not Market Recovery (UDP) Feed A
Declaration
public bool UseSnapshotFeedA { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
UseSnapshotFeedB
Gets or Set the flag to use or not Market Recovery (UDP) Feed B
Declaration
public bool UseSnapshotFeedB { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
AddSecurityGroupFilter(String)
Add the Security Group filtering value. The filter is inclusive.
Declaration
public void AddSecurityGroupFilter(string securityGroup)
Parameters
Type | Name | Description |
---|---|---|
System.String | securityGroup | SecurityGroup to be used for inclusive filtering. |
AddSecurityIdFilter(Int32)
Add the Security ID filtering value. The filter is inclusive. Note: this method can be called only when handler was in STOPPED, STARTED or SECURITY_DEFINITIONS_RECOVERY_STARTED state or from onSecurityDefinition callback. If this method will be called from other place this can lead to order book build errors for specified security.
Declaration
public void AddSecurityIdFilter(int securityId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | securityId | SecurityID to be used for inclusive filtering. |
AddSymbolFilter(String)
Add the Symbol filtering value. The filter is inclusive. Note: this method can be called only when handler was in STOPPED, STARTED or SECURITY_DEFINITIONS_RECOVERY_STARTED state or from onSecurityDefinition callback. If this method will be called from other place this can lead to order book build errors for specified security.
Declaration
public void AddSymbolFilter(string symbol)
Parameters
Type | Name | Description |
---|---|---|
System.String | symbol | Symbol to be used for inclusive filtering. |
ClearSecurityGroupFilters()
Removes all the Security Group filters.
Declaration
public void ClearSecurityGroupFilters()
ClearSecurityIdFilters()
Removes all the Security ID filters.
Declaration
public void ClearSecurityIdFilters()
ClearSymbolFilters()
Removes all the Symbol filters.
Declaration
public void ClearSymbolFilters()
Dispose()
Stops handler and clear resources.
Declaration
public void Dispose()
Dispose(Boolean)
Stops handler and clear resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | False to dispose native resources. |
LogDebug(String)
Write information text message to trace log.
Declaration
public static void LogDebug(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | Text message to log. |
Pause()
Pauses log replay.
Declaration
public void Pause()
RemoveSecurityGroupFilter(String)
Removes the Security Group filter value.
Declaration
public bool RemoveSecurityGroupFilter(string securityGroup)
Parameters
Type | Name | Description |
---|---|---|
System.String | securityGroup | SecurityGroup value to remove from Security Group filters. |
Returns
Type | Description |
---|---|
System.Boolean | true if the element is successfully found and removed; otherwise, false. |
RemoveSecurityIdFilter(Int32)
Removes the SecurityId filter value.
Declaration
public bool RemoveSecurityIdFilter(int securityId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | securityId | SecurityId value to remove from SecurityId filters. |
Returns
Type | Description |
---|---|
System.Boolean | true if the element is successfully found and removed; otherwise, false. |
RemoveSymbolFilter(String)
Removes the Symbol filter value.
Declaration
public bool RemoveSymbolFilter(string symbol)
Parameters
Type | Name | Description |
---|---|---|
System.String | symbol | Symbol value to remove from Symbol filters. |
Returns
Type | Description |
---|---|
System.Boolean | true if the element is successfully found and removed; otherwise, false. |
Resume()
Resumes log replay.
Declaration
public void Resume()
Start()
Starts the receiving and processing of market data.
Market joining strategy is Late Join. Security definitions was not cached.
Declaration
public void Start()
Start(HandlerStartupStrategy)
Starts the receiving and processing of market data.
Security definitions was not cached.
Declaration
public void Start(HandlerStartupStrategy startupStrategy)
Parameters
Type | Name | Description |
---|---|---|
HandlerStartupStrategy | startupStrategy | Market joining strategy. |
Start(HandlerStartupStrategy, Boolean)
Starts the receiving and processing of market data using startupStrategy and cache security definitions option.
Declaration
public void Start(HandlerStartupStrategy startupStrategy, bool cacheSecurityDefinitions)
Parameters
Type | Name | Description |
---|---|---|
HandlerStartupStrategy | startupStrategy | Market joining strategy. |
System.Boolean | cacheSecurityDefinitions | True if cache Security Definitions. |
Start(ReplayOptions)
Starts handler in replaying logs mode.
Declaration
public void Start(ReplayOptions options)
Parameters
Type | Name | Description |
---|---|---|
ReplayOptions | options | Replay options. |
Start(Boolean)
Starts the receiving and processing of market data using cache security definitions option. Market joining strategy is Late Join.
Declaration
public void Start(bool cacheSecurityDefinitions)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | cacheSecurityDefinitions | True if cache Security Definitions. |
Stop()
Stops the receiving and processing of market data.
Declaration
public void Stop()
Events
ConsolidatedOrderBookTopOfTheBookUpdated
Consolidated Order Book top of the book is updated.
Declaration
public event TopOfTheOrderBookUpdatedHandler<ImpliedPriceLevel> ConsolidatedOrderBookTopOfTheBookUpdated
Event Type
Type | Description |
---|---|
TopOfTheOrderBookUpdatedHandler<ImpliedPriceLevel> |
ConsolidatedOrderBookUpdated
Consolidated Order Book is updated.
Declaration
public event OrderBookUpdatedHandler<ConsolidatedOrderBook> ConsolidatedOrderBookUpdated
Event Type
Type | Description |
---|---|
OrderBookUpdatedHandler<ConsolidatedOrderBook> |
Error
Error is reported.
Declaration
public event ErrorHandler Error
Event Type
Type | Description |
---|---|
ErrorHandler |
FeedStateChanged
Feed's state is changed.
Declaration
public event FeedStateChangedHandler FeedStateChanged
Event Type
Type | Description |
---|---|
FeedStateChangedHandler |
ImpliedOrderBookChanged
Implied Order Book is changed.
Declaration
public event ImpliedOrderBookChangedHandler ImpliedOrderBookChanged
Event Type
Type | Description |
---|---|
ImpliedOrderBookChangedHandler |
ImpliedOrderBookReset
Implied Order Book is reset.
Declaration
public event OrderBookHandler<ImpliedOrderBook> ImpliedOrderBookReset
Event Type
Type | Description |
---|---|
OrderBookHandler<ImpliedOrderBook> |
ImpliedOrderBookTopOfTheBookUpdated
Implied Order Book top of the book is updated.
Declaration
public event TopOfTheOrderBookUpdatedHandler<ImpliedPriceLevel> ImpliedOrderBookTopOfTheBookUpdated
Event Type
Type | Description |
---|---|
TopOfTheOrderBookUpdatedHandler<ImpliedPriceLevel> |
ImpliedOrderBookUpdated
Implied Order Book is updated.
Declaration
public event OrderBookUpdatedHandler<ImpliedOrderBook> ImpliedOrderBookUpdated
Event Type
Type | Description |
---|---|
OrderBookUpdatedHandler<ImpliedOrderBook> |
Info
Information message is reported.
Declaration
public event InfoHandler Info
Event Type
Type | Description |
---|---|
InfoHandler |
MarketByOrderBookChanged
Market by Order Book is changed.
Declaration
public event MarketByOrderBookChangedHandler MarketByOrderBookChanged
Event Type
Type | Description |
---|---|
MarketByOrderBookChangedHandler |
MarketByOrderBookReset
Market by Order Book is reset.
Declaration
public event OrderBookHandler<MarketByOrderBook> MarketByOrderBookReset
Event Type
Type | Description |
---|---|
OrderBookHandler<MarketByOrderBook> |
MarketByOrderBookTopOfTheBookUpdated
Market By Order Book top of the book is updated.
Declaration
public event TopOfTheOrderBookUpdatedHandler<Order> MarketByOrderBookTopOfTheBookUpdated
Event Type
Type | Description |
---|---|
TopOfTheOrderBookUpdatedHandler<Order> |
MarketByOrderBookUpdated
Market by Order Book is updated.
Declaration
public event OrderBookUpdatedHandler<MarketByOrderBook> MarketByOrderBookUpdated
Event Type
Type | Description |
---|---|
OrderBookUpdatedHandler<MarketByOrderBook> |
MessageProcessingFinished
Message Processing Finished.
Declaration
public event MessageProcessingHandler MessageProcessingFinished
Event Type
Type | Description |
---|---|
MessageProcessingHandler |
MessageProcessingStarted
FIX message processing is started.
Declaration
public event MessageProcessingHandler MessageProcessingStarted
Event Type
Type | Description |
---|---|
MessageProcessingHandler |
NoDataOnFeedReceived
No data on feed is not received during ReceiveTimeoutInMilliseconds. To turn on this event property ReportNoDataWarning should be set to true.
Declaration
public event NoDataOnFeedReceivedHandler NoDataOnFeedReceived
Event Type
Type | Description |
---|---|
NoDataOnFeedReceivedHandler |
OrderIds
Order ids are received.
Declaration
public event OrderIdsReceivedHandler OrderIds
Event Type
Type | Description |
---|---|
OrderIdsReceivedHandler |
PacketProcessingFinished
Packet Processing Finished.
Declaration
public event PacketProcessingHandler PacketProcessingFinished
Event Type
Type | Description |
---|---|
PacketProcessingHandler |
PacketProcessingStarted
Packet processing is started.
Declaration
public event PacketProcessingHandler PacketProcessingStarted
Event Type
Type | Description |
---|---|
PacketProcessingHandler |
RegularOrderBookChanged
Regular Order Book is changed.
Declaration
public event RegularOrderBookChangedHandler RegularOrderBookChanged
Event Type
Type | Description |
---|---|
RegularOrderBookChangedHandler |
RegularOrderBookReset
Regular Order Book is reset.
Declaration
public event OrderBookHandler<RegularOrderBook> RegularOrderBookReset
Event Type
Type | Description |
---|---|
OrderBookHandler<RegularOrderBook> |
RegularOrderBookTopOfTheBookUpdated
Regular Order Book top of the book is updated.
Declaration
public event TopOfTheOrderBookUpdatedHandler<RegularPriceLevel> RegularOrderBookTopOfTheBookUpdated
Event Type
Type | Description |
---|---|
TopOfTheOrderBookUpdatedHandler<RegularPriceLevel> |
RegularOrderBookUpdated
Regular Order Book is updated.
Declaration
public event OrderBookUpdatedHandler<RegularOrderBook> RegularOrderBookUpdated
Event Type
Type | Description |
---|---|
OrderBookUpdatedHandler<RegularOrderBook> |
ReplayError
Error during logs replay is reported.
Declaration
public event ReplayErrorHandler ReplayError
Event Type
Type | Description |
---|---|
ReplayErrorHandler |
ReplayFinished
Logs replay finished.
Declaration
public event ReplayFinishedHandler ReplayFinished
Event Type
Type | Description |
---|---|
ReplayFinishedHandler |
RequestForQuote
Request for quote is received.
Declaration
public event RequestForQuoteReceivedHandler RequestForQuote
Event Type
Type | Description |
---|---|
RequestForQuoteReceivedHandler |
SecurityDefinitionDeleted
Security Definition message is deleted.
Declaration
public event SecurityDefinitionHandler SecurityDefinitionDeleted
Event Type
Type | Description |
---|---|
SecurityDefinitionHandler |
SecurityDefinitionReceived
Security Definition message is received.
Declaration
public event SecurityDefinitionHandler SecurityDefinitionReceived
Event Type
Type | Description |
---|---|
SecurityDefinitionHandler |
SecurityStatusChanged
Security Status is changed.
Declaration
public event SecurityStatusChangedHandler SecurityStatusChanged
Event Type
Type | Description |
---|---|
SecurityStatusChangedHandler |
StateChanged
Handler's state is changed.
Declaration
public event StateChangedHandler StateChanged
Event Type
Type | Description |
---|---|
StateChangedHandler |
Statistics
Statistics is received.
Declaration
public event StatisticsHandler Statistics
Event Type
Type | Description |
---|---|
StatisticsHandler |
StatisticsReset
Statistics reset is received.
Declaration
public event StatisticsResetHandler StatisticsReset
Event Type
Type | Description |
---|---|
StatisticsResetHandler |
Trade
Trade is received.
Declaration
public event TradeHandler Trade
Event Type
Type | Description |
---|---|
TradeHandler |
Warning
Warning is reported.
Declaration
public event WarningHandler Warning
Event Type
Type | Description |
---|---|
WarningHandler |