dxFeed Graal CXX API v9.0.0
Loading...
Searching...
No Matches
dxFeed Graal CXX API

dxFeed dxFeed

This package provides access to dxFeed market data. The library is built as a language-specific wrapper over the dxFeed Graal Native library, which was compiled with GraalVM Native Image and dxFeed Java API (our flagman API).

ℹ️ If you already use dxFeed C API, please see the Overview section.

Build Graal Native SDK Platform Release License

Table of Contents

Overview

Reasons for the New CXX API Repository

The old version of dxFeed C API, has several architectural restrictions that prevent us from providing a state-of-the-art technological solution.

Benefits of the New Version

  • 🚀 Increased performance
  • 🌌 Wider functionality
  • ♊ Identical programming interfaces to our best API
  • 👍 Higher quality of support and service

Milestones

Feature development has already stopped for the old version of dxFeed C API.

The old version will be considered deprecated, and at the end of 2024, we plan to end the service. If you’re already our customer and have difficulty with a future transition, please contact us via our customer portal.

Migration

To help you rewrite the existing API calls, we’ve prepared samples demonstrating how to work with the new API and how several functionalities are implemented. More examples will follow. The table below shows the sample mapping between the old and new versions.

Our support team on our customer portal is ready to answer any questions and help with the transition.

Implementation Details

We use GraalVM Native Image technology and specially written code that wraps Java methods into native ones to get dynamically linked libraries for different platforms (Linux, macOS, and Windows) based on the latest Java API package.

Then, the resulting dynamic link library (dxFeed Graal-native) is used through C ABI (application binary interface), and we write programming interfaces that describe our business model (similar to Java API).

As a result, we get a full-featured, similar performance as with Java API. Regardless of the language, writing the final application logic using API calls will be very similar (only the syntax will be amended, "best practices", specific language restrictions).

Below is a scheme of this process:

API scheme API scheme

Architectural Restrictions and Other Limitations of the Old Version

# Limitation How It’s Solved in the New Version
1 Single-threaded architecture limiting throughput Based on the Java API, each subscription object (DXFeedSubscription) can run on its own thread
2 User code in event callbacks (for example, dxf_event_listener_t) is executed in the socket read thread, which can significantly reduce throughput Socket processing threads and callback threads are separated
3 In event callbacks, one market event type and one data portion always arrive (excluding snapshot subscription), which increases the load on the CPU with a large amount of incoming data Event callbacks can receive different market event types, and more than one by batch
4 It’s impossible to subscribe to data without getting regionals (if it is available for the market event) or only for a certain regional subscription->addSymbols({"AAPL"}); - composite
subscription->addSymbols({"AAPL&Q"}); - regional
5 It’s impossible to subscribe to Order event (excluding snapshot subscription) without getting: all sources, Order by Quote (including regionals), Order by MarketMaker subscription->addSymbols(IndexedEventSubscriptionSymbol::create("AAPL", OrderSource::NTV)); - OrderSource determines which data is being subscribed to
6 Data is mixed up when creating two subscriptions (regular and time series) for the same market event type. Both regular and time series data go to both subscriptions Each subscription instance receives only the data requested
7 Each subsequent request for the same symbol set in a subscription instance overwrites the existing one in another subscription instance Subscription instances and the data they receive are independent of each other
8 Removing a symbol from one subscription instance caused it to be removed from all others Subscription instances and the data they receive are independent of each other
9 Incorrect behavior when reading from a file (if a market event in the file has not been subscribed to). Reading from a file always occurs at maximum speed. The supported format is binary only endpoint->connect("file:tape.txt[format=text]"); - processing a text file with at it's "real" speed by timestamps
endpoint->connect("file:tape.bin[format=binary,speed=max]"); - processing a binary file with max speed

Documentation

Find useful information in our self-service dxFeed Knowledge Base or CXX API documentation:

Requirements

Windows

Only x64 versions are supported.

OS Version Architectures
Windows 8, 8.1 x64
Windows 10 Version 1607+ x64
Windows 11 Version 22000+ x64
Windows Server 2012+ x64
Windows Server Core 2012+ x64
Nano Server Version 1809+ x64

Requirements

Linux

x64 and aarch64 (arm64) versions are prebuilt.

libc compatibility

  • glibc: 2.28+ and the libstdc++ of GCC 8+: Oracle Linux / RHEL 8+, Debian 10+, Ubuntu 20.04+. Every release is checked on Oracle Linux 8 and Ubuntu 22.04.
  • musl: temporarily unsupported

libpthread compatibility

A symlink on libpthread.so, libpthread.so.0, or libcoreclr.so must exist.

macOS

OS Version Architectures
macOS 10.15+ x64
macOS 11+ Arm64

Installation

Examples of how to install the library and integrate with the library can be found here.

The API is delivered as a shared library and a static one, built from the sources or unpacked from the Lib archive of a release:

File Windows Linux macOS
Shared library bin\dxFeedGraalCxxApi.dll, lib\dxFeedGraalCxxApi.lib lib/libdxFeedGraalCxxApi.so.<major> lib/libdxFeedGraalCxxApi.<major>.dylib
Static library lib\dxFeedGraalCxxApi_static.lib lib/libdxFeedGraalCxxApi_static.a lib/libdxFeedGraalCxxApi_static.a
dxFeed Graal Native SDK bin\DxFeedGraalNativeSdk.dll, lib\DxFeedGraalNativeSdk.lib lib/libDxFeedGraalNativeSdk.so lib/libDxFeedGraalNativeSdk.dylib

The archives of a release are .tar.gz on Linux and macOS, which keeps the unversioned library names as links, and .zip on Windows. They use lib/. Installed from the sources, the libraries go to the CMAKE_INSTALL_LIBDIR of GNUInstallDirs, which is lib64 on the Red Hat family of Linux distributions; -DCMAKE_INSTALL_LIBDIR=lib keeps lib/.

Both libraries load the library of the dxFeed Graal Native SDK at run time: ship it with your program, next to it or in the search path of the dynamic loader (PATH, RPATH/RUNPATH, LD_LIBRARY_PATH), and the shared library of the API too when you use it. The major version in the name of the shared library changes with every incompatible change of its interface. Neither library passes its compiler options to your code: compile it with your own.

With CMake

The targets are the same in all the ways below: dxfcxx::dxfcxx (the shared library), dxfcxx::static (the static library) and dxfcxx::graal (the SDK library). They give your target the include directory and the definitions it needs, such as DXFCPP_USE_DLLS with the shared library.

An installed or unpacked package (CMAKE_PREFIX_PATH points to it):

find_package(dxFeedGraalCxxApi CONFIG REQUIRED)
target_link_libraries(app PRIVATE dxfcxx::dxfcxx) # or dxfcxx::static

The sources, by FetchContent or as a directory of your project:

include(FetchContent)
FetchContent_Declare(dxFeedGraalCxxApi URL https://github.com/dxFeed/dxfeed-graal-cxx-api/archive/refs/tags/<version>.zip)
FetchContent_MakeAvailable(dxFeedGraalCxxApi)
# or: add_subdirectory(dxfeed-graal-cxx-api)
target_link_libraries(app PRIVATE dxfcxx::static) # or dxfcxx::dxfcxx

As a subproject, the API builds no tests, samples or tools and installs nothing (-DDXFCXX_INSTALL=ON installs it with your project). The -static-mt packages have no dxfcxx::dxfcxx (see below).

On Windows, copy the DLLs next to your program:

add_custom_command(TARGET app POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_RUNTIME_DLLS:app> $<TARGET_FILE_DIR:app> COMMAND_EXPAND_LISTS)

On Linux and macOS, the programs of your build tree find the libraries by RUNPATH; install them with your program and set its INSTALL_RPATH (for example, $ORIGIN/../lib).

Without CMake

Add the include directory to the include path and link the libraries of the table above:

  • The shared library: define DXFCPP_USE_DLLS (required on Windows, and on Linux and macOS when your code is compiled with -fvisibility=hidden), link lib\dxFeedGraalCxxApi.lib (Windows) or -ldxFeedGraalCxxApi (Linux, macOS), ship the shared library and the SDK library.
  • The static library: do not define DXFCPP_USE_DLLS, link the static library and the SDK library (lib\DxFeedGraalNativeSdk.lib, -lDxFeedGraalNativeSdk), and -lpthread on Linux; ship the SDK library.
  • A package built with DXFCXX_FEATURE_STACKTRACE=ON (the releases) links its static library with Boost.Stacktrace: link lib/libboost_stacktrace_backtrace.a -ldl -lbacktrace (Linux), lib/libboost_stacktrace_addr2line.a -ldl (macOS) or lib\boost_stacktrace_windbg.lib ole32.lib dbgeng.lib (Windows) too, whichever is in lib.
  • MSVC: compile with /std:c++20 /EHsc; /utf-8 is not needed.

Windows without the Visual C++ Redistributable

The dxFeedGraalCxxApi-<version>-x86_64-windows-<build type>-static-mt.zip archives are built with the static C runtime and need no Visual C++ Redistributable. Compile your code with /MT (/MTd with the Debug archive) and /std:c++20, with Visual Studio 2022 17.14 or newer (MSVC 14.44 or newer): an older linker or standard library does not link the static libraries of the archive. Link the static C++ API in one of two ways:

Way Link Ship next to your exe or dll
Static C++ API, SDK DLL lib\dxFeedGraalCxxApi_static.lib, lib\DxFeedGraalNativeSdk.lib bin\DxFeedGraalNativeSdk.dll
Single exe or dll lib\dxFeedGraalCxxApi_static.lib, lib\DxFeedGraalNativeSdk_static.lib, the libraries of lib\link-flags.txt nothing

The single exe or dll depends only on Windows DLLs and adds about 55 MB. lib\link-flags.txt lists the Windows libraries one per line (psapi.lib, winhttp.lib, ws2_32.lib, etc.), so cl takes it as a response file: @lib\link-flags.txt. The Debug archive contains the same SDK libraries as the other archives: they do not depend on the C runtime variant.

These archives have no dxFeedGraalCxxApi.dll: with the static C runtime, the DLL and your code would each have their own C runtime, and the interface of the C++ API passes standard library objects (std::string, std::shared_ptr, etc.) between them. To build the libraries yourself, or the DLL for its C API, use the static-mt Full Source Bundle (see "Full Source Bundles" in HOW_TO_BUILD.md).

With CMake, find_package(dxFeedGraalCxxApi CONFIG) gives dxfcxx::static (the first way) and dxfcxx::graal; set CMAKE_MSVC_RUNTIME_LIBRARY to MultiThreaded$<$<CONFIG:Debug>:Debug> in your project.

For example, a build.cmd run from the x64 Native Tools Command Prompt (%1 is the unpacked archive):

@echo off
set "A=%~f1"
rem Static C++ API, SDK DLL
cl /nologo /std:c++20 /MT /EHsc /I "%A%\include" main.cpp "%A%\lib\dxFeedGraalCxxApi_static.lib" ^
"%A%\lib\DxFeedGraalNativeSdk.lib" /Fe:main.exe || exit /b 1
copy /y "%A%\bin\DxFeedGraalNativeSdk.dll" . >nul
rem Single exe
cl /nologo /std:c++20 /MT /EHsc /I "%A%\include" main.cpp "%A%\lib\dxFeedGraalCxxApi_static.lib" ^
"%A%\lib\DxFeedGraalNativeSdk_static.lib" @"%A%\lib\link-flags.txt" /Fe:main-single.exe

Verifying a download

From v9 on, each archive of a release has an SBOM next to it: <archive name without .zip or .tar.gz>.cdx.json (CycloneDX 1.6 JSON). It lists what the archive contains: the C++ libraries of the archive, the Graal Native SDK with the GraalVM and the JDK that built it and the Java libraries of the SDK, with their versions, licenses and links.

SHA256SUMS of the release has the SHA-256 of every archive and SBOM. Download it to the directory of the archives and check them:

sha256sum -c SHA256SUMS --ignore-missing # Linux
shasum -a 256 -c SHA256SUMS --ignore-missing # macOS

On Windows, compare the output of Get-FileHash <archive> (PowerShell) with the line of the archive in SHA256SUMS.

The files listed in SHA256SUMS also have a build provenance attestation: it shows that the file was built by the release workflow of this repository, and from which commit. Check it with the GitHub CLI:

gh attestation verify dxFeedGraalCxxApi-<version>-<platform>-Release.tar.gz --repo dxFeed/dxfeed-graal-cxx-api

Usage

How to connect to QD endpoint

To use the dynamic library define the DXFCPP_USE_DLLS preprocessor directive.

#include <iostream>
#include <dxfeed_graal_cpp_api/api.hpp>
int main() {
using namespace dxfcpp;
// For token-based authorization, use the following address format:
// "demo.dxfeed.com:7300[login=entitle:token]"
auto endpoint = DXEndpoint::newBuilder()
->withProperty("dxfeed.address", "demo.dxfeed.com:7300")
->build();
// Another way to connect the endpoint.
// auto endpoint = DXEndpoint::create()->connect("demo.dxfeed.com:7300");
auto subscription = endpoint->getFeed()->createSubscription(Quote::TYPE);
subscription->addEventListener([](auto&& events) {
for (auto&& e : events) {
std::cout << e << "\n";
}
});
subscription->addSymbols({"AAPL"});
std::cin.get();
}
static const EventTypeEnum & TYPE
Type identifier and additional information about the current event class.
Definition Quote.hpp:71
static std::shared_ptr< Builder > newBuilder()
Creates a new Builder instance.
Definition DXEndpoint.cpp:870
Output


I 221219 224811.681 [main] QD - Using QDS-3.313+file-UNKNOWN+mars-UNKNOWN+monitoring-UNKNOWN+tools-UNKNOWN, (C) Devexperts
I 221219 224811.695 [main] QD - Using scheme com.dxfeed.api.impl.DXFeedScheme DH2FdjP0DtOEIOAbE4pRVpmJsPnaZzAo1mICPJ6b06w
I 221219 224812.010 [main] QD - qd with collectors [Ticker, Stream, History]
I 221219 224812.017 [main] ClientSocket-Distributor - Starting ClientSocketConnector to demo.dxfeed.com:7300
I 221219 224812.017 [demo.dxfeed.com:7300-Reader] ClientSocketConnector - Resolving IPs for demo.dxfeed.com
I 221219 224812.021 [demo.dxfeed.com:7300-Reader] ClientSocketConnector - Connecting to 208.93.103.170:7300
I 221219 224812.170 [demo.dxfeed.com:7300-Reader] ClientSocketConnector - Connected to 208.93.103.170:7300
D 221219 224812.319 [demo.dxfeed.com:7300-Reader] QD - Distributor received protocol descriptor multiplexor@WQMPz [type=qtp, version=QDS-3.306, opt=hs, mars.root=mdd.demo-amazon.multiplexor-demo1] sending [TICKER, STREAM, HISTORY, DATA] from 208.93.103.170
Quote{AAPL, eventTime=0, time=20221219-223311.000, timeNanoPart=0, sequence=0, bidTime=20221219-223311, bidExchange=Q, bidPrice=132.16, bidSize=2, askTime=20221219-223311, askExchange=K, askPrice=132.17, askSize=10}
Quote{AAPL, eventTime=0, time=20221219-223312.000, timeNanoPart=0, sequence=0, bidTime=20221219-223312, bidExchange=Q, bidPrice=132.16, bidSize=6, askTime=20221219-223312, askExchange=K, askPrice=132.17, askSize=10}
Quote{AAPL, eventTime=0, time=20221219-223312.000, timeNanoPart=0, sequence=0, bidTime=20221219-223312, bidExchange=K, bidPrice=132.16, bidSize=10, askTime=20221219-223312, askExchange=V, askPrice=132.17, askSize=4}

How to connect to dxLink

#include <iostream>
#include <dxfeed_graal_cpp_api/api.hpp>
int main() {
using namespace dxfcpp;
// Enable experimental feature.
System::setProperty("dxfeed.experimental.dxlink.enable", "true");
// Set scheme for dxLink.
System::setProperty("scheme", "ext:opt:sysprops,opt:dxprops,resource:dxlink.xml");
// For token-based authorization, use the following address format:
// "dxlink:wss://demo.dxfeed.com/market-data/dxlink-ws[login=dxlink:token]"
auto endpoint = DXEndpoint::newBuilder()
->withProperty("dxfeed.address", "dxlink:wss://demo.dxfeed.com/market-data/dxlink-ws")
->build();
// Another way to connect the endpoint.
// auto endpoint = DXEndpoint::create()->connect("dxlink:wss://demo.dxfeed.com/market-data/dxlink-ws");
auto subscription = endpoint->getFeed()->createSubscription(Quote::TYPE);
subscription->addEventListener([](auto&& events) {
for (auto&& e : events) {
std::cout << e << "\n";
}
});
subscription->addSymbols({"AAPL"});
std::cin.get();
}
static bool setProperty(StringParam key, StringParam value)
Sets the JVM system property indicated by the specified key.
Definition System.cpp:116
Output


I 231130 154554.594 [main] QD - Using QDS-3.325+file-UNKNOWN, (C) Devexperts
I 231130 154554.602 [main] QD - Using scheme com.dxfeed.api.impl.DXFeedScheme slfwemJduh1J7ibvy9oo8DABTNhNALFQfw0KmE40CMI
I 231130 154555.094 [main] MARS - Started time synchronization tracker using multicast 239.192.51.45:5145 with gixCx
I 231130 154555.100 [main] MARS - Started JVM self-monitoring
I 231130 154555.100 [main] QD - monitoring with collectors [Ticker, Stream, History]
I 231130 154555.103 [main] QD - monitoring DXEndpoint with dxfeed.address=dxlink:wss://demo.dxfeed.com/market-data/dxlink-ws
I 231130 154555.105 [main] DxLinkClientWebSocket-Distributor - Starting DxLinkClientWebSocketConnector to wss://demo.dxfeed.com/market-data/dxlink-ws
I 231130 154555.107 [wss://demo.dxfeed.com/market-data/dxlink-ws-Writer] DxLinkClientWebSocket-Distributor - Connecting to wss://demo.dxfeed.com/market-data/dxlink-ws
I 231130 154556.640 [wss://demo.dxfeed.com/market-data/dxlink-ws-Writer] DxLinkClientWebSocket-Distributor - Connected to wss://demo.dxfeed.com/market-data/dxlink-ws
D 231130 154557.801 [oioEventLoopGroup-2-1] QD - Distributor received protocol descriptor [type=dxlink, version=0.1-0.18-20231017-133150, keepaliveTimeout=120, acceptKeepaliveTimeout=5] sending [] from wss://demo.dxfeed.com/market-data/dxlink-ws
D 231130 154557.802 [oioEventLoopGroup-2-1] QD - Distributor received protocol descriptor [type=dxlink, version=0.1-0.18-20231017-133150, keepaliveTimeout=120, acceptKeepaliveTimeout=5, authentication=] sending [] from wss://demo.dxfeed.com/market-data/dxlink-ws
Quote{AAPL, eventTime=0, time=20231130-152903.000, timeNanoPart=0, sequence=0, bidTime=20231130-152903, bidExchange=P, bidPrice=189.9, bidSize=5.0, askTime=20231130-152854, askExchange=K, askPrice=189.98, askSize=10.0}

To familiarize with the dxLink protocol, please click here.

Versions and addresses in the log

When there is no data, start with the Diagnose command of the Tools: it checks the way to the data step by step and prints a verdict.

Tools Diagnose demo.dxfeed.com:7300 Quote,Trade AAPL,IBM --report diagnose.txt

It prints the versions, resolves each host to its IP addresses and tries a TCP connect to each, connects an endpoint and prints its states and connection errors, subscribes for 10 seconds (--duration) and prints the first events, the number of events per type, the time of the last event per symbol and the delay of the events. The verdict:

  • DATA: the events came for all types and symbols; PARTIAL DATA: for some of them (the others are listed);
  • CONNECTED, NO DATA: connected, but no events: likely not entitled or not in the endpoint filter; check the endpoint IPF (a symbol that does not trade now is silent too);
  • CANNOT CONNECT: with the last connection error; CANNOT RESOLVE: the host name does not resolve.

--compare <address2> runs the same check for a second address and compares the two. --report <file> writes the output to a file that can be attached to a question to the support: logins, passwords and tokens are hidden. The exit code is 0 for DATA and 2 to 5 for the other verdicts. The next steps for each verdict, the connection errors and what the endpoint restores after a reconnect are in Troubleshooting.

When a question goes to the support, start with these lines of the output of the program:

  • [dxfcpp] INFO #1 DXEndpoint: dxFeed Graal C++ API v9.0.0, dxFeed Graal Native SDK 3.19.0, Windows x86_64(16 cores): the versions and the platform, written to stderr once per process when the first endpoint is created (through ErrorManager, see its documentation to redirect or turn off the output);
  • Using QDS-<version>, (C) Devexperts: the version of QD inside the SDK;
  • DXEndpoint is loading properties from <file> and <name> DXEndpoint with dxfeed.address=<address>: the properties file (dxfeed.properties) and the address that the endpoint uses.

DXEndpoint::connect takes a QD address such as demo.dxfeed.com:7300[login=entitle:token] or dxlink:wss://.... An http(s):// or ws(s):// URL (REST, CometD, IPF) is not an address of an endpoint: connect throws InvalidArgumentException with the expected form.

Tools

Tools is a collection of utilities that allow you to subscribe to various market events for the specified symbols. The tools can be downloaded from Release:

  • Diagnose checks the way to the data of an address step by step (DNS, TCP, the endpoint, the events) and prints a verdict with a hint: the first step when there is no data (see Versions and addresses in the log)
  • Connect connects to the specified address(es) and subscribes to the specified events with the specified symbol
  • Dump dumps all events received from address. This was designed to retrieve data from a file
  • PerfTest connects to the specified address(es) and calculates performance counters (events per second, memory usage, CPU usage, etc.)
  • LatencyTest connects to the specified address(es) and calculates latency
  • Qds collection of tools ported from the Java qds-tools
  • NetTest publishes generated events or receives them and measures the end-to-end lag, by the NetTest specification of the Graal Native SDK

On macOS, it might be required to remove the quarantine attribute to run certain tools:

sudo /usr/bin/xattr -r -d com.apple.quarantine <directory_with_tools>

NetTest

Tools NetTest is the C++ API tool of the NetTest specification nettest/1 of the Graal Native SDK 3.19.0 (docs/wrapper-guide/nettest.md of the SDK sources): the command line, the output lines, the summary file, the /metrics endpoint and the exit codes are those of the NetTest of the other APIs, so one stand runs and compares them. Tools NetTest --help prints the options. For example, a producer at 500,000 events per second and a consumer of the stream contract with the summary of each side:

Tools NetTest p :7001 -S 100000 -c stream -r */500k --duration 5m --summary producer.json
Tools NetTest c 127.0.0.1:7001 -S 100000 -c stream --warmup 30s --duration 5m --summary consumer.json

The -Xmx<size>, -Xms<size>, -Xmn<size>, -Xss<size> and -XX:<option> options go to the Graal isolate, in the command line order, when it is created (as System::setIsolateArguments() does); the DXFCPP_ISOLATE_ARGUMENTS environment variable adds its arguments after them. Other -X arguments are command line errors. An option that the isolate rejects (-Xmx64q, an unknown -XX: option) ends the tool with exit code 2: the isolate prints its reason to stderr, and the tool adds the line NetTest: the isolate rejected one of the options: <the options>.

Differences from the specification

  • --legacy is not supported (unsupported option: --legacy, exit code 2): the C++ API has no deprecated publishing call.
  • reuse_effective of the producer summary is always false: the C++ API copies the published events into the isolate, so --reuse changes only the C++ objects.
  • The isolate is not torn down at the end of the run, so the options of the isolate that print at its tear-down, such as -XX:+PrintGCSummary, print nothing.

Samples

API

  • AuthSample demonstrates how to connect to an endpoint that requires an authentication token, subscribe to market data events, and handle periodic token updates
  • ConnectSample demonstrates how to connect to the endpoint and subscribe to various market events
  • PrintQuoteEventsSample is a simple demonstration of how to subscribe to the Quote event, using a DxFeed instance singleton and dxfeed.properties file
  • RequestProfileSample using address like "localhost:7700" and a symbol list "A:TEST" it connects to the running PublishProfilesSample, prints symbol profile event, and exits.
  • ReconnectSample demonstrates how to connect to an endpoint, subscribe to market data events, handle reconnections and re-subscribing, connect to a list of addresses and log the state of the connectors with the last connection error

Candle

  • CandleSample demonstrates how to subscribe to Candle events from a time with the candle symbol attributes

Console

  • LastEventConsoleSample demonstrates how to subscribe to various market events with the dxFeed API, cache them in memory, and take snapshots of these events based on user input

File

  • ConvertTapeFileSample demonstrates how to convert one tape file to another tape file with optional intermediate processing or filtering

IPF

  • IpfSample is a simple demonstration of how to get Instrument Profiles
  • IpfLiveSample is a simple demonstration of how to get live updates for Instrument Profiles from the IPF service or a file
  • OptionChainSample demonstrates how to build option chains, and prints quotes for nearby option strikes

Model

  • PriceLevelBookSample demonstrates how to compile a price level book (market by price) that aggregates individual orders (market by order)

Schedule

  • ScheduleSample demonstrates how to get various scheduling information for instruments: whether the market is open at a time, the sessions and the holidays

OnDemand

  • OnDemandSample a sample that demonstrates how to use the dxFeed on-demand history data replay service API

ORCS

UI

  • DXFeedTimeAndSalesSample displays the latest 30 TimeAndSale events and the instrument description in a cross-platform Dear ImGui window. It accumulates snapshots and updates received from IndexedTxModel; the endpoint is configured in dxfeed.system.properties. Enter a symbol and press Enter (or Subscribe) to change the subscription.
  • MarketDepthModelSample demonstrates how to draw a Market Depth.
  • CandleChartSample demonstrates how to draw a Candlestick Chart.
  • PriceLevelBookSample demonstrates how to compile a price level book (market by price) that aggregates individual orders (market by order)

On macOS, it might be required to remove the quarantine attribute to run certain samples:

sudo /usr/bin/xattr -r -d com.apple.quarantine <directory_with_samples>

Current State

Endpoint Roles

  • FEED connects to the remote data feed provider and is optimized for real-time or delayed data processing, this is a default role
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • STREAM_FEED is similar to FEED and also connects to the remote data feed provider but is designed for bulk data parsing from files
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • PUBLISHER connects to the remote publisher hub (also known as multiplexor) or creates a publisher on the local host (WriteTapeFile)
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • STREAM_PUBLISHER is similar to PUBLISHER and also connects to the remote publisher hub, but is designed for bulk data publishing
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • LOCAL_HUB is a local hub without the ability to establish network connections. Events published via publisher are delivered to local feed only.
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • ON_DEMAND_FEED is similar to FEED, but it is designed to be used with OnDemandService for historical data replay only
    • dxFeed Graal C API
    • dxFeed Graal C++ API

Event Types

  • Order is a snapshot of the full available market depth for a symbol
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • SpreadOrder is a snapshot of the full available market depth for all spreads
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • AnalyticOrder represents an extension of Order introducing analytic information, e.g., adding iceberg-related information to this order
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • Trade is a snapshot of the price and size of the last trade during regular trading hours and an overall day volume and day turnover
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • TradeETH is a snapshot of the price and size of the last trade during extended trading hours and the extended trading hours day volume and day turnover
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • Candle - event with open, high, low, and close prices and other information for a specific period
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • Quote is a snapshot of the best bid and ask prices and other fields that change with each quote
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • Profile is a snapshot that contains the security instrument description
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • Summary is a snapshot of the trading session, including session highs, lows, etc.
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • TimeAndSale - represents a trade or other market event with price, like market open/close price, etc.
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • Greeks is a snapshot of the option price, Black-Scholes volatility, and Greeks
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • Series is a snapshot of computed values available for all options series for a given underlying symbol based on options market prices
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • TheoPrice is a snapshot of the theoretical option price computation that is periodically performed by dxPrice model-free computation
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • Underlying is a snapshot of computed values available for an option underlying symbol based on the market’s option prices
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • Message is an event with an application-specific attachment
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • OptionSale is an event that represents a trade or another market event with the price (for example, market open/close price, etc.) for each option symbol listed under the specified Underlying
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • OtcMarketsOrder represents an extension of Order for the symbols traded on the OTC Markets
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • OrderImbalance shows the imbalance between buy and sell orders during auctions
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • NuamOrder is an extension of Order for the NUAM exchange
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • NuamTrade is an extension of Trade for the NUAM exchange
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • NuamTimeAndSale is an extension of TimeAndSale for the NUAM exchange
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • MarketMaker is the bid and ask of a market maker on an exchange
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • TextConfiguration is a configuration event with a text payload and a version
    • dxFeed Graal C API
    • dxFeed Graal C++ API

Subscription Symbols

  • String is a string representation of the symbol
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • TimeSeriesSubscriptionSymbol represents subscription to time-series events
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • IndexedEventSubscriptionSymbol represents subscription to a specific source of indexed events
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • WildcardSymbol.ALL represents a wildcard subscription to all events of the specific event type
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • CandleSymbol symbol used with DXFeedSubscription class to subscribe for Candle events
    • dxFeed Graal C API
    • dxFeed Graal C++ API

Subscriptions & Models

  • DXFeedSubscription is a subscription for a set of symbols and event types
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • GetLastEvent returns the last event for the specified event instance
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • GetTimeSeriesPromise requests time series events for the specified event type, symbol, and time range
    • dxFeed Graal C API
    • dxFeed Graal C++ API

IPF & Schedule

  • InstrumentProfile represents basic profile information about a market instrument
    • dxFeed Graal C API
  • InstrumentProfileReader reads instrument profiles from the stream using Instrument Profile Format (IPF).
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • InstrumentProfileConnection connects to an instrument profile URL and reads instrument profiles with support of streaming live updates.
    • dxFeed Graal C API
    • dxFeed Graal C++ API
  • InstrumentProfileCollector collects instrument profile updates and provides the live instrument profiles list
    • dxFeed Graal C API
  • Schedule provides API to retrieve and explore various exchanges’ trading schedules and different financial instrument classes
    • dxFeed Graal C API

Services