Skip to content

tickup-se/mlink_subscribe_test

Repository files navigation

MLink stream test

Based on SpiderRocks example code the live_prints program streams a set of tickers and counts the number of open and close cross trades.

The program historic_prints is reading trough a historic file and outputs the number of open and close trades.

build all

MacOS:

macos

brew install boost openssl protobuf
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .

Ubuntu 24.04:

ubuntu-22.04

sudo apt-get update
sudo apt-get install -y libboost-all-dev libssl-dev build-essential protobuf-compiler libprotobuf-dev libprotoc-dev
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --parallel $(nproc)

usage:

Live data

./live_prints <API_KEY>

TYPE: 1 = StockPrint, 2 = StockPrintSet DUMP: 0 = do not dump prints, 1 = dump prints to stdout API_KEY: SpiderRock key

Will every 10 seconds output debug information formated like this:

(time: 15:02:04 [CEST]) open cross trades: 0 close cross trades: 0 unique open: 0 unique close: 0 no. print messages: 0

Is saving a file every minute containing the current seen ticker names for open and close cross trades named: open_trades.txt and close_trades.txt at the location executing the program. The files can be used by the tool file_compare to compare the ticker names in the historic and live data.

  1. The local time and the local timezone where the code runs
  2. number of open cross trades seen from the subscribed universe
  3. number of close cross trades seen from the subscribed universe
  4. unique open is the number of unique open cross trades mening if AAPL would receive two open cross unique open would count that as one (open cross trades should be the same as this parameter)
  5. unique close is the number of unique close cross trades mening if AAPL would receive two close cross unique close would count that as one (close cross trades should be the same as this parameter)
  6. no. print messages the number of all StockPrint messages without any filter decoded

./live_prints_no_filter <API_KEY>

Same as above but is subscribing to the full universe and filters out the instruments in the callback. (is only capable of StockPrint and not dumping all to stdout)

Historic data

./historic_prints <FILE_NAME>

First outputs the column names and their respective column number. Outputs heart beat every 100.000 rows When a open print is found the name of the ticker is detailed. At the end the number of open prints are displayed.

Filtered section, prefix (filtered)

Number is the number of occasions open/close crosses within the ticker universe filter.

Unique per ticker name, should be the same as the above counters. If for example AAPL occurs twice or more, then the counter count one.

Non filtered section, prefix (no filtered)

Number is the number of occasions open/close crosses messages.

Unique per ticker name, should be the same as the above counters. If for example AAPL occurs twice or more, then the counter count one.

The program outputs two files: open_trades.txt and close_trades.txt. The files can be used by the tool file_compare to compare the ticker names in the historic and live data.

Compare data

./file_compare <FILE_NAME_1> <FILE_NAME_2>

Compares the two files created by the live and historic parsers/streams and outputs the information about missing data.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages