← Technical Guides

Reconcile OUCH executions with a TotalView-ITCH book

Connect an order gateway and a market-data handler to a synthetic Nasdaq-format venue, reconcile match numbers, and repeat the test in CI.

OUCH 5.0 carries a participant’s private order requests and responses. TotalView-ITCH 5.0 describes visible events on the market book. A partial fill belongs in both a customer’s ordered execution history and its market-data view. These views refer to different orders when a new order takes resting liquidity. The shared match number connects them.

Work through one trade

The default lab opens with four shares of synthetic NOVA offered at 100.0000. Enter a visible day buy for ten at that price. The gateway receives an OUCH acceptance for its own order and an execution for four shares. On ITCH, the execution references the resting offer’s order reference number. The execution’s match number equals the one on the private OUCH execution. ITCH then adds the remaining six bid shares under the order reference assigned in the private acceptance.

Replace the buy with a total liability of nine at 99.5000. Four shares have already executed. Both the OUCH replacement and the ITCH replacement expose five remaining shares and a new order reference. Cancel with an intended total of zero. OUCH acknowledges a five-share reduction and ITCH deletes that reference. Finally enter a limit at 120.0000. With the default band of 90.0000 through 110.0000 the gateway receives rejection reason 29 and the public book is unchanged.

Run the test with your own client

  1. Open the binary workspace, create a team and save its access files. The OUCH order and ITCH book reconciliation template fills in the venue, acceptance steps and two application checks. Publish the profile as binary-uat. Open the binary workspace
  2. Store the workspace ID and CI key in FIXSCOPE_WORKSPACE and FIXSCOPE_API_KEY. Download the Node 24 runner and example client to your test directory. CI runner · Example binary client
  3. Run the example below. Replace the command after the double dash with your gateway and feed-handler test command when integrating your application.
node fixscope-ci.mjs --profile binary-uat --revision 1 --build gateway-1 --junit binary.xml -- node fixscope-binary-client.mjs

The runner supplies FIXSCOPE_BINARY_HOST, FIXSCOPE_OUCH_PORT, FIXSCOPE_ITCH_PORT, FIXSCOPE_SOUP_USER and FIXSCOPE_SOUP_PASSWORD. Both ports are on loopback. Write the independently observed numeric or boolean checks to FIXSCOPE_CHECKS_FILE. The default expects booked_quantity and feed_executed to each equal four. The server grades its generated wire exchanges. Your application checks establish what your code actually received and booked. The resulting report supports previous-build comparison, invited runs, linked retests and separate reviewer approvals. Team CI setup and role model

Connect an existing SoupBinTCP implementation

Start a run, download the participant file and TCP bridge, then run node fixscope-bridge.mjs fixscope-participant.json. The default OUCH port is 19876 and the ITCH feed is 19877. Override the ports with FIXSCOPE_LOCAL_PORT and FIXSCOPE_LOCAL_ITCH_PORT. A feed-only recipient gets the separate ITCH access file. Running the bridge with that single file uses FIXSCOPE_LOCAL_PORT, default 19876, for the feed.

Use SoupBinTCP 4.0 on each connection. The bridge authenticates its WebSocket with a per-run, per-channel key. The inner synthetic login uses username UAT and password SIMULATED. Leave the session blank on first login and request sequence 1 to include the opening events. Read the session and initial sequence from Login Accepted. Increment the sequence only for each S packet. Send a client heartbeat during idle periods. To resume, request the next sequence your application needs for that channel. Sequence zero requests the most recently generated message if one exists. A request outside the retained window receives Login Rejected with reason S. The lab retains 128 outgoing messages per channel, survives transport disconnects and removes the book and both histories when the run ends.

Implemented messages

Stream Supported application messages
OUCH requests O enter, U replace, X cancel or reduce
OUCH responses S system event, A accepted, U replaced, C canceled, E executed, J rejected
ITCH generated by the lab S system event, R stock directory, H trading action, A add, E executed, X partial cancel, D delete, U replace
Additional ITCH inspector layouts F attributed add, C execution with price, P trade, Q cross trade, B broken trade

The hosted lab models one synthetic symbol, visible continuous-market limit orders, day and IOC, and price/time priority. Configure the symbol, opening ask price and shares, price band, maximum order size, seeded rejection percentage and lifetime. Prices have four implied decimal places. The lab uses a deterministic synthetic session clock starting at 09:30. One gateway and one feed subscriber can connect per run. A bounded book holds up to 128 live orders. The inspector preserves structurally valid optional OUCH tag-value bytes. The lab supports the base layouts and rejects unsupported order attributes. Cross auctions, hidden orders, private extensions, live multicast and official exchange certification are outside this lab.

Inspect an existing binary capture

For a PCAP or PCAPNG, select the capture and its protocol specification in Packet Capture. The analyzer separates order and market-data ports and assembles TCP bytes before applying the message layouts. Inspect a packet capture

Select the application and direction, choose framing, then paste hex or open a local binary file. The application type U has different layouts in the two OUCH directions. A standalone ITCH file with two-byte message lengths differs from a SoupBinTCP stream, whose packet type precedes the application byte. Choose MoldUDP64 for one ITCH downstream datagram including its 20-byte header. The inspector preserves 64-bit identifiers and timestamps as decimal strings and labels malformed or unsupported records at their byte offset. Local input is limited to 1 MiB and 4,096 framed records. Open the binary inspector

The implementations follow Nasdaq’s published wire specifications. The examples and simulated order flow are original synthetic data. Nasdaq OUCH 5.0 · Nasdaq TotalView-ITCH 5.0 · SoupBinTCP 4.0 · MoldUDP64

Select a historical venue revision

Team UAT can pair each of the 17 Nasdaq US equities OUCH editions with each of the 11 TotalView-ITCH editions in the reference matrix. Pick both editions, then apply the starter plan. By default it buys ten shares at the opening offer, cancels the six-share remainder and sends an out-of-band order. Edit the plan when changing opening liquidity or venue policies. Download the specification ZIP to see the wire fields, transport, source documents and a capture sidecar using your bridge ports. Nasdaq edition matrix

OUCH 1.x uses carriage-return-terminated messages. A successful native login returns Welcome and Heartbeat. Respond with I and request W with the next sequence number to replay. Execution and cancellation messages include the remaining order size. Native rejects are unsequenced. An unknown cancel token receives JK with reason #UNK. The historical token table retains up to 384 distinct client tokens per run. OUCH 2.x and 3.x wrap ASCII applications in SoupTCP. OUCH 4.x uses binary SoupBinTCP with space-padded order tokens. Enter and cancel span all editions. Replace is available in 4.x and 5.0. Supported historical time-in-force values are IOC (0) and day (99998 or 99999). Only visible orders with zero minimum quantity enter the historical matching path.

The feed emits events supported by its edition. For example, a full removal is an X share decrement in ITCH 1.x and 2.x. Later feeds can use D to delete an order. Editions without order replace publish the removal and a new add. A 3.x feed provides separate seconds and milliseconds messages, while a 4.x feed uses seconds plus the subsecond field on each book update. The exported capture specification binds both channels independently. SBE order entry with an ITCH feed