This package provides access to dxFeed market data. The library is build as a thin wrapper over dxFeed C API library.
Find useful information in self-service dxFeed Knowledge Base, or .NET API framework documentation:
System requirements: Visual C++ Redistributable 2015, .NET Framework 4.5.2+, Visual Studio.
- Download the latest version of dxFeed .NET API (
dxfeed-net-api-x.x.x-windows.zip
). - Extract archive.
- Copy
dxf_api.dll
,dxf_native.dll
,DXFeed.dll
,DXFeed_64.dll
,DXFeedd.dll
,DXFeedd_64.dll
,libcrypto-41.dll
,libcrypto-41_64.dll
,libssl-43.dll
,libssl-43_64.dll
,libtls-15.dll
,libtls-15_64.dll
to\lib
folder of your Project. - Open Visual Studio.
- Open Solution Explorer 🠒 Project (
.csproj
file) 🠒 References 🠒 Add Reference 🠒 Browse 🠒 Add. Then choosedxf_api.dll
,dxf_native.dll
libraries to add them to your Project. - Open Solution Explorer 🠒 Project (
.csproj
file) 🠒 Add 🠒 Existing Item 🠒 Add As Link. Then chooseDXFeed.dll
,DXFeed_64.dll
,DXFeedd.dll
,DXFeedd_64.dll
,libcrypto-41.dll
,libcrypto-41_64.dll
,libssl-43.dll
,libssl-43_64.dll
,libtls-15.dll
,libtls-15_64.dll
libraries to add them to your Project. - Add
using
directive in class (.cs
file):
using com.dxfeed.api;
using com.dxfeed.native;
Coming soon
Coming soon
# | EventType | Short description | Examples of original feed events | Interface |
---|---|---|---|---|
1 | Trade | The price and size of the last trade during regular trading hours, an overall day volume and day turnover | Trade (last sale), trade conditions change messages, volume setting events, index value | IDxTrade |
2 | TradeETH | The price and size of the last trade during extended trading hours, and the extended trading hours day volume and day turnover | Trade (last sale), trade conditions change messages, volume setting events | IDxTradeETH |
3 | TimeAndSale | The trade or other market event with price that provides information about trades in a continuous time slice (unlike Trade events, which are supposed to provide a snapshot of the current last trade) | Trade, index value | IDxTimeAndSale |
4 | Quote | The best bid and ask prices and other fields that may change with each quote. It represents the most recent information that is available about the best quote on the market | BBO Quote (bid/ask), regional Quote (bid/ask) | IDxQuote |
5 | Order | Depending on the Scope flag it may be: composite BBO from the whole market or regional BBO from a particular exchange or aggregated information (e.g. PLB - price level book) or individual order (FOD - full order depth) |
Regional Quote (bid/ask), depth (order books, price levels, market maker quotes), market depth | IDxOrder |
6 | SpreadOrder | Multi-leg order | Regional Quote (bid/ask), depth (order books, price levels, market maker quotes), market depth | IDxSpreadOrder |
7 | Candle | OHLCV candle | Charting aggregations | IDxCandle |
8 | Profile | The most recent information that is available about the traded security on the market | Instrument definition, trading halt/resume messages | IDxProfile |
9 | Summary | The most recent OHLC information about the trading session on the market | OHLC setting events (trades, explicit hi/lo update messages, explicit summary messages) | IDxSummary |
10 | Greeks | Differential values that show how the price of an option depends on other market parameters | Greeks and Black-Scholes implied volatility | IDxGreeks |
11 | TheoPrice | The theoretical option price | Theoretical prices | IDxTheoPrice |
12 | Underlying | Calculated values that are available for an option underlying symbol based on the option prices on the market | VIX methodology implied volatility, P/C ratios | IDxUnderlying |
13 | Series | Properties of the underlying | VIX methodology implied volatility, P/C ratios | IDxSeries |
ℹ️ CODE SAMPLE: take a look at EventType usage in dxf_events_sample, dxf_candle_sample |
---|
✅ READ MORE: Events to be published for different feed types, feed types and events matrix |
---|
There are three types of delivery contracts: Ticker
, Stream
and History
. You can set up the contract type by EventSubscriptionFlag as a parameter of NativeConnection.
The main task of this contract is to reliably deliver the latest value for an event (for example, for the last trade of the selected symbol). Queued older events could be conflated to conserve bandwidth and resources.
A stream contract guaranteedly delivers a stream of events without conflation.
History contract first delivers a snapshot (set of previous events) for the specified time range (subject to limitations). After the snapshot is transmitted, the history contract delivers a stream of events.
ℹ️ NOTE: if EventSubscriptionFlag is not set, the default contract type will be enabled. |
---|
Default contracts for events (in most cases):
Ticker | Stream | History |
---|---|---|
Trade | TimeAndSale | Order |
TradeETH | SpreadOrder | |
Quote | Candle | |
Profile | Series | |
Summary | Greeks | |
Greeks | ||
TheoPrice | ||
Underlying |
ℹ️ CODE SAMPLE: take a look at EventSubscriptionFlag usage in dxf_client |
---|
✅ READ MORE: Event delivery contracts |
---|
# | Subscription type | Description | Code sample |
---|---|---|---|
1 | CreateSubscription | Creates subscription to an event | dxf_events_sample |
2 | CreateSnapshotSubscription | Creates a snapshot subscription | dxf_snapshot_sample |
3 | CreateIncOrderSnapshotSubscription | Creates the new native subscription to Order snapshot with incremental updates | dxf_inc_order_snapshot_sample |
4 | CreatePriceLevelBook | Creates the new price level book (10 levels) for the specified symbol and sources | dxf_price_level_book_sample |
5 | CreateRegionalBook | Creates a regional price level book (10 levels) | dxf_regional_book_sample |
Order source identifies source of IDxOrder
and IDxSpreadOrder
events. You can set Order source by SetSource() method of IDxSubscription. Several supported sources are listed below. Please find the full list here.
Aggregated:
-
AGGREGATE_ASK, AGGREGATE_BID - Ask, Bid side of an aggregate order book (futures depth and Nasdaq Level II)
Full order depth:
- BATE - Cboe EU BXE (BATE)
- BYX - Cboe BYX
- BZX - Cboe BZX
- BXTR - Cboe EU SI (Systematic Internaliser)
- BI20 - BIST Top20 Orders (Level2+)
- CHIX - Cboe EU CXE (Chi-X)
- CEUX - Cboe EU DXE
- CFE - Cboe CFE
- C2OX - Cboe C2
- DEA - Cboe EDGA
- DEX - Cboe EDGX
- ERIS - ErisX
- ESPD - Nasdaq E-speed
- FAIR - FairX
- GLBX - Globex
- ICE - ICE Futures US/EU
- IST - Borsa Istanbul
- MEMX - Members Exchange
- NTV - Nasdaq TotalView
- NFX - Nasdaq NFX
- SMFE - SmallEx
- XNFI - Nasdaq NFI
- XEUR - Eurex
Price level book:
- glbx - CME Globex
- iex - IEX
- memx - Members Exchange
- ntv - Nasdaq TotalView
- smfe - SmallEx
- xeur - Eurex
ℹ️ CODE SAMPLE: take a look at OrderSource usage in dxf_price_level_book_sample |
---|
✅ READ MORE: Order sources |
---|
//creating connection handler
var connection = new NativeConnection("demo.dxfeed.com:7300", _ => { });
//creating subscription handler
var subscription = connection.CreateSubscription(EventType.Quote, new EventPrinter());
//creating subscription handler with Ticker contract
var subscription = connection.CreateSubscription(EventType.Quote, EventSubscriptionFlag.ForceTicker, new EventPrinter());
//adding single symbol
subscription.AddSymbols("AAPL");
//adding array of symbols
subscription.AddSymbols(new string[] { "AAPL", "MSFT" });
//adding all available symbols
subscription.AddSymbols("*");
//setting Nasdaq TotalView FOD source
subscription.SetSource("NTV");
//creating connection handler
using (var connection = new NativeConnection("demo.dxfeed.com:7300", DisconnectHandler))
{
//creating subscription handler,
//passing object of type 'EventPrinter' as an argument
//to invoke callback method when data received
using (var subscription = connection.CreateSubscription(EventType.Quote, new EventPrinter()))
{
//adding subscription to 'AAPL' symbol
subscription.AddSymbols("AAPL");
Console.WriteLine("Press enter to stop");
Console.ReadLine();
}
}
//implementation of 'DisconnectHandler' method which passed as an argument
//in 'NativeConnection' constructor
private static void DisconnectHandler(IDxConnection _) =>
Console.WriteLine("Disconnected");
//implementation of class 'EventPrinter' which object passed as an argument
//in 'CreateSubscription' method
public class EventPrinter: IDxFeedListener
{
//implementation of callback method 'OnQuote' of 'IDxFeedListener' interface
public void OnQuote<TB, TE>(TB buf)
where TB : IDxEventBuf<TE>
where TE : IDxQuote {
foreach (var q in buf)
Console.WriteLine($"{buf.Symbol} {q}");
}
}
Output:
AAPL Quote: {AAPL, AskExchangeCode: 'U', Ask: [email protected], AskTime: 2021-07-29T12:42:21.0000000Z, BidExchangeCode: 'U', Bid: [email protected], BidTime: 2021-07-29T12:44:06.0000000Z, Scope: Regional}
AAPL Quote: {AAPL, AskExchangeCode: 'V', Ask: [email protected], AskTime: 2021-07-29T12:46:47.0000000Z, BidExchangeCode: 'V', Bid: [email protected], BidTime: 2021-07-29T12:47:17.0000000Z, Scope: Regional}
AAPL Quote: {AAPL, AskExchangeCode: 'W', Ask: [email protected], AskTime: 2017-07-04T02:44:04.0000000Z, BidExchangeCode: 'W', Bid: [email protected], BidTime: 2017-07-04T02:44:04.0000000Z, Scope: Regional}
AAPL Quote: {AAPL, AskExchangeCode: 'X', Ask: [email protected], AskTime: 2021-07-29T12:46:19.0000000Z, BidExchangeCode: 'X', Bid: [email protected], BidTime: 2021-07-29T12:42:07.0000000Z, Scope: Regional}
AAPL Quote: {AAPL, AskExchangeCode: 'Y', Ask: [email protected], AskTime: 2021-07-29T12:44:50.0000000Z, BidExchangeCode: 'Y', Bid: [email protected], BidTime: 2021-07-29T12:42:06.0000000Z, Scope: Regional}
AAPL Quote: {AAPL, AskExchangeCode: 'Z', Ask: [email protected], AskTime: 2021-07-29T12:46:51.0000000Z, BidExchangeCode: 'Z', Bid: [email protected], BidTime: 2021-07-29T12:47:28.0000000Z, Scope: Regional}
AAPL Quote: {AAPL, AskExchangeCode: 'K', Ask: [email protected], AskTime: 2021-07-29T12:47:28.0000000Z, BidExchangeCode: 'K', Bid: [email protected], BidTime: 2021-07-29T12:47:29.0000000Z, Scope: Composite}
dxf_client - demonstrates some commonly used .NET API functions
https://github.com/dxFeed/dxfeed-net-api/tree/master/samples:
- dxf_candle_sample - demonstrates how to subscribe to
Candle
event. - dxf_candle_data_retrieving_sample - demonstrates how to retrieve
Candle
data from the candle web service. - dxf_tns_data_retrieving_sample - demonstrates how to retrieve
TimeAndSale
data from the candle web service. - dxf_events_sample - demonstrates how to subscribe to
Quote
,Trade
,TradeETH
,Order
,SpreadOrder
,Profile
,Summary
,TimeAndSale
,Underlying
,TheoPrice
,Series
,Greeks
,Configuration
events. - dxf_inc_order_snapshot_sample - demonstrates how to subscribe to order snapshot with incremental updates.
- dxf_instrument_profile_live_sample - demonstrates how to subscribe to IPF live updates.
- dxf_instrument_profile_sample - demonstrates how to receive IPF data from URL or file.
- dxf_ipf_connect_sample - demonstrates how to subscribe to events by symbols from downloaded IPF (from URL or file).
- dxf_price_level_book_sample - demonstrates how to subscribe to a price level book.
- dxf_read_write_raw_data_sample - demonstrates how to save/read incoming binary traffic to/from file.
- dxf_regional_book_sample - demonstrates how to subscribe to regional price level book.
- dxf_simple_data_retrieving_sample - demonstrates how to receive snapshots of
TimeAndSale
,Candle
,Series
,Greeks
events on a given time interval without subscription. - dxf_snapshot_sample - demonstrates how to subscribe to
Order
,SpreadOrder
,Candle
,TimeAndSale
,Greeks
,Series
snapshots.