Wed Dec 28 22:51:36 UTC 2022 - last commit message “don’t install everything”

Financial Information eXchange

See Wikipedia and the repo whence this came.

Example messages

Body length is the character count starting at tag 35 (included) all the way to tag 10 (excluded). SOH delimiters do count in body length.

8=FIX.4.2 | 9=178 | 35=8 | 49=PHLX | 56=PERS | 52=20071123-05:30:00.000 | 11=ATOMNOCCC9990900 | 20=3 | 150=E | 39=E | 55=MSFT | 167=CS | 54=1 | 38=15 | 40=2 | 44=15 | 58=PHLX EQUITY TESTING | 59=0 | 47=C | 32=0 | 31=0 | 151=15 | 14=0 | 6=0 | 10=128 |

SOH character is used as a delimiter.

8=FIX.4.49=14835=D34=108049=TESTBUY152=20180920-18:14:19.50856=TESTSELL111=63673064027889863415=USD21=238=700040=154=155=MSFT60=20180920-18:14:19.49210=092 

FIX protocol (explained by a quant developer)

See Coding Jesus and CME FIX standard for the tag specification.

There are two layers: - Session (log on, heartbeat, data integrity, sequencing) - Application (buy, sell, cancel, modify, replace, quote)

Refs

Must have

See Darwinex.

Standard header

tag value
8 BeginString
9 BodyLength
35 MsgType
49 SenderCompID
56 TargetCompID
34 MsgSeqNum
52 SendingTime

Message Body

Sequence of tab=value pairs depending on message type.

Standard trailer

Example tags

Header tags 8-255

Body tags 256+

Trailer tags

Examples order

See part 1 and Darwinex tutorial.

stunnel used for order session authentication, price sessions don’t require SSH.

Message type

Symbol

Order ack

Side

Price

Order type

Routing

APIs

Refs


gprof

gtest

Running main() from ./googletest/src/gtest_main.cc
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from fixi
[ RUN      ] fixi.string_split
8=FIX.4.4
9=148
35=D
34=1080
49=TESTBUY1
52=20180920-18:14:19.508
56=TESTSELL1
11=636730640278898634
15=USD
21=2
38=7000
40=1
54=1
55=MSFT
60=20180920-18:14:19.492
10=092

[       OK ] fixi.string_split (0 ms)
[----------] 1 test from fixi (0 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (0 ms total)
[  PASSED  ] 1 test.

main.cxx

#include <iomanip>
#include <ranges>
#include <string>
#include <vector>

#include "fmt/core.h"    // for print
#include "gtest/gtest.h" // for Test, AssertionResult, Message, TestPartResult

TEST(fixi, string_split) {
  constexpr auto message = std::string_view{
      "8=FIX.4.4␁9=148␁35=D␁34=1080␁49=TESTBUY1␁52=20180920-18:14:19.508␁56="
      "TESTSELL1␁11=636730640278898634␁15=USD␁21=2␁38=7000␁40=1␁54=1␁55=MSFT␁"
      "60=20180920-18:14:19.492␁10=092␁"};
  constexpr auto delim = std::string_view{"␁"};

  for (const auto tag_value : std::views::split(message, delim))
    fmt::print("{}\n",
               std::string_view{std::cbegin(tag_value), std::cend(tag_value)});
}