OUCH Trading Specification
for Equities
Version 1.12
Updated 20 February 2023

OUCH Trading Specification for Equities

2023-02-20

Table of Contents
1.

Introduction .................................................................................................................................. 3

2.

Overview ...................................................................................................................................... 3

3.

Fault Redundancy ......................................................................................................................... 3

4.

Service Configuration ................................................................................................................... 3

5.

Data Types .................................................................................................................................... 3

6.

Inbound Messages ........................................................................................................................ 3

7.

6.1

Enter Order Message ............................................................................................................. 4

6.2

Replace Order Message ......................................................................................................... 5

6.3

Cancel Order Message .......................................................................................................... 6

Outbound Sequenced Messages ................................................................................................... 6
7.1

System Event Message .......................................................................................................... 6

7.2

Order Accepted Message ....................................................................................................... 6

7.3

Order Replaced Message ....................................................................................................... 8

7.4

Order Canceled Message ....................................................................................................... 97.5

Order AIQ Canceled Message ............................................................................................... 97.6

Order Executed Message ..................................................................................................... 10

7.7

Order Rejected Message...................................................................................................... 10

Revision History ................................................................................................................................ 122

OUCH Trading Specification for Equities

1.

2023-02-20

Introduction

This document explains access to the equities trading services of Japannext PTS via the OUCH protocol. It
describes the service's configuration and specifies the application messages. For further information andinquiries regarding trading services or for questions concerning connectivity please contact Japannext PTS
Technical Support via email to: ito@japannext.co.jp.

2.

Overview

The message protocol of OUCH is widely used and considered an industry standard. By using the OUCH
protocol, clients are able to access different markets and liquidity pools operated by Japannext PTS. They
can enter new orders, modify or cancel existing orders, and receive execution reports in real-time.
The point-to-point transport layer for OUCH messages is SoupBinTCP.

3.

Fault Redundancy

A single OUCH account can be bound to multiple physical OUCH machines, which then act as mirrors ofeach other for fault redundancy. In this configuration, these OUCH machines are able to accept orders andcancel requests, and any outbound messages will be simultaneously generated.

4.

Service Configuration

An OUCH trading service can be configured to accept and maintain multiple OUCH sessions per client.
However only one active connection is allowed to a particular OUCH machine per account.
For any client's OUCH account, the Cancel on Disconnect feature is always active. All open orders createdby an OUCH account which has lost connection to all OUCH hosts due to any reason, will be automaticallywithdrawn. For every withdrawn order an unsolicited cancellation message will be sent to the client uponconnection re-establishment.

5.

Data Types

Integer fields are unsigned big-endian (network byte order) binary encoded numbers.
Alpha fields are left-justified and padded on the right with spaces.
Token fields are 4 byte Integer fields. They are sequential and increasing, and must be unique per OUCH
account within a trading day.
Price fields are 4 byte Integer fields. When converted to fixed point number format they have 9 whole
number digits and 1 decimal place. The maximum representable value is 214,748,364.6 (7FFFFFFE hex).
Quantity fields are 4 byte Integer fields with a maximum representable value of 2,147,483,647 (7FFFFFFFhex).

6.

Inbound Messages

Inbound messages are sent from the client's application to the OUCH host. All inbound messages may berepeated benignly. This gives the client the ability to re-send any inbound message if it is uncertain whether
Japannext PTS received it in the case of a connection loss or an application error.
The idea of benign inbound message retransmission with end-to-end acknowledgment is fundamental to thefault redundancy implementation. If the client's connection ever fails, there is no way of knowing if pending
messages actually made it over the link before the failure. A robust OUCH client can safely re-send any
pending messages over a mirrored link without worrying about generating duplicates.
All inbound messages on an OUCH port are processed sequentially. This guarantees that if two orders are3

OUCH Trading Specification for Equities

2023-02-20entered consecutively on the same connection, the first order entered will always be accepted first.

6.1 Enter Order Message
An Enter Order Message is used to enter a new order into the Japannext PTS execution system.
Every valid order sent is acknowledged by an Order Accepted Message. An Enter Order Message with an Order
Token out of sequence will be silently ignored.
Name

OffsetLengthTypeComments

Message Type

01

Alpha

Value is O = Enter Order Message.

Order Token

14

TokenMust be unique per OUCH account within a trading day and increasing.

Client Reference

510Alpha

Assigned by the client.
This field is forwarded to the clearing and settlement venues.
There is no validation of this field.

Buy/SellIndicator

151Alpha

Side of order.
Values:B = Buy
S = Sell
T = Short sell
E = Short sell exempt

Quantity

164Integer

Number of shares.

Orderbook Id

20

4

Alpha

Quick code.

Group244

Alpha

Orderbook group identifier.
Values:DAY = Daytime J-Market
NGHT = Nighttime J-Market
DAYX = X-Market
DAYU = U-Market

Price

28

4IntegerPrice of the order.

Time in Force

324Integer

Specifies how long the order remains in effect.
Values:0 = Immediate
99999 = Day
Other values are not supported (order will be rejected).

Firm Id

364Integer

Identifier for the order entry firm.
This field should be set to zero unless specifying a client's MPID.
Also forwarded to the downstream systems if required.

Display

40

1

Alpha

Instructions for order handling.
Values:P = Post-only
Leave blank if unused.

Capacity

41

1

Alpha

Designates the capacity of the firm placing the order.
Values:A = Agency
P = Principal

Minimum
Quantity

424Integer

Specifies the minimum acceptable quantity to execute.
Non zero values are only supported for immediate orders.

4OUCH Trading Specification for Equities
NameOffset

LengthType

OrderClassification

46

1AlphaHigh Frequency Trading (HFT) order classification.
Values:
1 = Non HFT
3 = HFT market making strategy
4 = HFT arbitrage strategy
5 = HFT directional strategy
6 = HFT other strategy

Cash Margin
Type471AlphaCash margin type of the order.
Values:
1 = Cash
2 = Margin open (Negotiable)
3 = Margin close (Negotiable)
4 = Margin open (Standardized)
5 = Margin close (Standardized)

2023-02-20

Comments

6.2 Replace Order Message
A Replace Order Message is used to modify an existing order. It requires two valid order tokens, an existing
token which must match an existing order for that account and a replacement token which must comply as
for the Enter Order Message.
A Replace Order Message will be silently ignored if the Existing Order Token is no longer live or theReplacement Order Token is out of sequence.
If the order associated with the Existing Order Token is live but the replace details (except the Replacement
Order Token) are invalid, the order will be canceled and removed from the book. In this case theReplacement Order Token is not consumed and may be reused.
The Quantity field on the Replace Order Message denotes the total quantity for the entire order chain. For
example:•An order is entered for a quantity of 100, it is validated and accepted.

•A quantity of 25 is executed.

•An additional quantity of 15 is executed.

•If the client wishes to replace the order and still be exposed for the balance of 60, then the Replace
Order Message must specify a quantity of 100 – the current balance plus the cumulative executedquantity.

An order may not be replaced with a new total quantity less than the cumulative executed quantity. An
attempt to do so results in the cancellation of the existing order.
For an order replaced with a new total quantity equal to the cumulative executed quantity, the replace is
accepted with state Dead.
NameOffset

LengthType

Comments

Message Type

01

Alpha

Value is U = Replace Order Message.

Existing Order
Token

14

Token

Must match exactly with that of the current live order.

Replacement
Order Token

54

Token

Must be unique per OUCH account within a trading day and increasing.

Quantity

94Integer

Total number of shares for the entire order chain, that is, the desired balanceplus the cumulative number of shares executed.

Price

134Integer

Price of the order.

5OUCH Trading Specification for Equities
NameOffset

LengthTypeTime in Force

174Integer

Specifies how long the order remains in effect.
Values:0 = Immediate
99999 = Day
Other values are not supported (order will be rejected).

Display211Alpha

Instructions for order handling.
Values:P = Post-only
Leave blank if unused.

MinimumQuantity

224Integer

Specifies the minimum acceptable quantity to execute.
Non zero values are only supported for immediate orders.

2023-02-20

Comments

6.3 Cancel Order Message
A Cancel Order Message is used to request that an order be canceled.
Note that the only acknowledgment to a Cancel Order Message is the resulting Order Canceled Message. There is no“too late to cancel” message and superfluous Cancel Order Messages are silently ignored.
NameOffset

LengthType

Comments

Message Type

01AlphaValue is X = Cancel Order Message.

Order Token

14TokenMust match exactly with that of the current live order.

Quantity

54Integer

Reserved.
Field will be ignored, although recommended to set to zero.

Outbound Sequenced Messages

7.

Outbound messages are generated by the OUCH host and received by the client's application.

7.1 System Event Message
A System Event Message signals a Japannext PTS system wide event.
NameOffset

LengthType

Comments

Message Type

01AlphaValue is S = System Event Message.

Timestamp

1

8Integer

Number of nanoseconds past midnight of the current calendar date.

System Event91Alpha

Refer to the System Events table below.

Table 1: System Events
EventDescription

SStart of Day – Always the first message. Indicates the market is open and ready tostart accepting orders.

EEnd of Day – Indicates the market is closed and will not accept any new orders.
There will be no further executions.

7.2 Order Accepted Message
An Order Accepted Message acknowledges the receipt and acceptance of a valid Enter Order Message. The data
fields from the Enter Order Message are echoed back in this message.
An Order Accepted Message is sent with state Dead for an immediate order which is accepted but fails to6OUCH Trading Specification for Equities

2023-02-20execute. No additional messages will be sent for that order. Order state Dead means that the order wasaccepted and automatically canceled.
NameOffset

LengthType

Comments

Message Type

01AlphaValue is A = Order Accepted Message.

Timestamp

18Integer

Number of nanoseconds past midnight of the current calendar date.

Order Token

94Token

Order Token as entered.

Client Reference

1310Alpha

Client Reference as entered.

Buy/SellIndicator

231Alpha

Buy/Sell Indicator as entered.
Values:B = Buy
S = Sell
T = Short sell
E = Short sell exempt

Quantity

244Integer

Number of shares accepted.

Orderbook Id

284Alpha

Orderbook identifier as entered.

Group324Alpha

Orderbook group identifier as entered.
Values:DAY = Daytime J-Market
NGHT = Nighttime J-Market
DAYX = X-Market
DAYU = U-Market

Price

364Integer

Accepted price of the order.

Time in Force

404Integer

Time in Force as accepted.
Values:0 = Immediate
99999 = Day

Firm Id

444Integer

Firm identifier as accepted.

Display481Alpha

Display as accepted.
Values:P = Post-onlyBlank if unused.

Capacity49

1AlphaCapacity of the firm placing the order as entered.
Values:A = Agency
P = Principal

Order Number508Integer

Day unique reference number of the order.

Minimum
Quantity

58

4Integer

The accepted minimum acceptable quantity to execute.

Order State

62

1AlphaOrder state upon acceptance.
Values:
L = Live
D = Dead

OrderClassification

63

1AlphaHigh Frequency Trading (HFT) order classification.
Values:
1 = Non HFT
3 = HFT market making strategy
4 = HFT arbitrage strategy
5 = HFT directional strategy
6 = HFT other strategy

7

OUCH Trading Specification for Equities
Name
Cash MarginTypeOffset

Length64

1TypeAlpha2023-02-20

Comments
Cash margin type of the order.
Values:
1 = Cash
2 = Margin open (Negotiable)
3 = Margin close (Negotiable)
4 = Margin open (Standardized)
5 = Margin close (Standardized)

7.3 Order Replaced Message
An Order Replaced Message acknowledges the receipt and acceptance of a valid Replace Order Message. The data
fields from the Replace Order Message are echoed back in this message.
In the same manner as Order Accepted Messages, Order Replaced Messages sent with state Dead denote that a replace
was accepted and then automatically canceled.
NameOffset

LengthType

Comments

Message Type

01

Alpha

Value is U = Order Replaced Message.

Timestamp

18Integer

Number of nanoseconds past midnight of the current calendar date.

Replacement
Order Token

94TokenReplacement Order Token as entered.

Buy/SellIndicator

131

Alpha

Buy/Sell Indicator as entered on the original order in the chain.
Values:B = Buy
S = Sell
T = Short sell
E = Short sell exempt

Quantity

144IntegerTotal number of shares outstanding.

Orderbook Id

184Alpha

Orderbook identifier as entered on the original order in the chain.

Group224Alpha

Orderbook group identifier as entered on the original order in the chain.
Values:DAY = Daytime J-Market
NGHT = Nighttime J-Market
DAYX = X-Market
DAYU = U-Market

Price

264Integer

Accepted price of the order.

Time in Force

304Integer

Time in Force as accepted.
Values:0 = Immediate
99999 = Day

Display341Alpha

Display as accepted.
Values:P = Post-only
Blank if unused.

Order Number358Integer

Day unique reference number of the order.

MinimumQuantity

434Integer

The accepted minimum acceptable quantity to execute.

Order State

471Alpha

Order state upon replacement.
Values:
L = Live
D = Dead8

OUCH Trading Specification for Equities
Name
Previous Order
Token

OffsetLength

48

4Type
Token

2023-02-20

Comments
Order token of the replaced order.

7.4 Order Canceled Message
An Order Canceled Message informs that an order has been canceled. This could be acknowledging a Cancel Order
Message, or it could be the result of the order being canceled automatically.
Name

OffsetLengthTypeComments

Message Type

01

Alpha

Value is C = Order Canceled Message.

Timestamp

18Integer

Number of nanoseconds past midnight of the current calendar date.

Order Token

94

Token

Order token of the canceled order.

Decrement
Quantity

134Integer

Number of shares decremented from the order.
This number is incremental, not cumulative.

Order Canceled
Reason171Alpha

Reason the order was reduced or canceled.
Refer to the Order Canceled Reasons table below.

Table 2: Order Canceled ReasonsReasonDescription

U

User requested the order to be canceled. Sent in response to a Cancel OrderMessage or a Replace Order Message.

LUser logged off.

SThis order was manually canceled by a supervisory terminal. For example,
emergency withdraw per user's request or the user got suspended.

I

An order with 'Immediate' Time In Force was executed and with no further matches
available on the book the remaining quantity was canceled.

M

Order expired during match.

X

Invalid price.

Z

Invalid quantity.

N

Invalid minimum quantity.

Y

Invalid order type.

D

Invalid display type.

V

Exceeded order value limit.

i

Short sell order restriction.

R

Order not allowed at this time.

F

Flow control is enabled and this OUCH port is being throttled.

GMargin order canceled due to margin restriction.

OOther.

7.5 Order AIQ Canceled Message
An Order AIQ Canceled Message informs that an order has been canceled by Japannext PTS trading system toprevent a self-trade. This is an extended version of the Order Canceled Message with specifics of the preventedtrade.
9OUCH Trading Specification for Equities
Name

Type

2023-02-20

OffsetLengthComments

Message Type

01AlphaValue is D = Order AIQ Canceled Message.

Timestamp

18Integer

Number of nanoseconds past midnight of the current calendar date.

Order Token

94Token

Order token of the canceled order.

Decrement
Quantity

134Integer

Number of shares decremented from the order.
This number is incremental, not cumulative.

Order Canceled
Reason171Alpha

Reason the order was reduced or canceled.
Value is M = Order expired during match.

Quantity
Prevented fromTrading

184Integer

Number of shares that would have executed if the trade had occurred.

Execution Price

224Integer

Price at which the trade would have occurred.

Liquidity
Indicator

26

1AlphaIdentifies whether this would-be trade was a result of a liquidity provider
providing or liquidity taker taking the liquidity.
Values:A = Added (for the passive firm)
R = Removed (for the aggressor)

7.6 Order Executed Message
An Order Executed Message informs that all or part of an order has been executed.
Name

OffsetLengthType

Comments

Message Type

01AlphaValue is E = Order Executed Message.

Timestamp

18Integer

Number of nanoseconds past midnight of the current calendar date.

Order Token

94Token

Order token of the executed order.

Executed
Quantity

134Integer

Incremental number of shares executed.

Execution Price

174Integer

Price at which the shares were executed.

LiquidityIndicator

211Alpha

Identifies whether this trade was a result of a liquidity provider providing or
liquidity taker taking the liquidity.
Values:A = Added (for the passive firm)
R = Removed (for the aggressor)

Match Number

228Integer

Day unique reference number of the match.
The matching buy and sell executions have the same match number.

7.7 Order Rejected Message
An Order Rejected Message may be sent in response to an Enter Order Message if the order cannot be accepted.
NameOffsetLengthType

Comments

Message Type01

Alpha

Value is J = Order Rejected Message.

Timestamp

18Integer

Number of nanoseconds past midnight of the current calendar date.

Order Token

94

Token

Order token of the rejected order.

Order Rejected
Reason131

Alpha

Reason the order was rejected.
Refer to the Order Rejected Reasons table below.

10

OUCH Trading Specification for Equities

Table 3: Order Rejected ReasonsReasonDescription

H

There is currently a trading halt so no orders can be accepted on this orderbook at
this time.

S

Invalid orderbook identifier.

X

Invalid price.

Z

Invalid quantity.

N

Invalid minimum quantity.

Y

Invalid order type.

D

Invalid display type.

V

Exceeded order value limit.

i

Short sell order restriction.

R

Order not allowed at this time.

F

Flow control is enabled and this OUCH port is being throttled.

G

Invalid margin specification.

L

MPID not allowed for this port.

c

User does not have permission to enter an order on the given board.

OOther.

112023-02-20

OUCH Trading Specification for Equities

2023-02-20Revision History
DateVersion

Description

2012-04-23 1.0

Initial revision.

2012-11-07 1.1

Added Quantity field to the Cancel Order Message.
Added Decrement Quantity field to the Canceled Message.
Updated Canceled Order Reasons.
Updated Rejected Order Reasons.

2012-12-12 1.2

Changed Firm Id field format to integer.
Updated Rejected Order Reasons.
Documented that Cancel on Disconnect feature is always active.

2013-07-09 1.3

Added Display value “P”.
Updated Canceled Order Reasons.
Updated Rejected Order Reasons.

2014-03-20 1.4

Added AIQ Canceled Message.

2015-01-22 1.5

Mentioned U-Market.

2016-02-10 1.6

Added “F” to Canceled Order Reasons and Rejected Order Reasons.

2017-10-26 1.7

Replaced Order Reference Number field name with Order Number.
Replaced Security Id field name with Orderbook Id.

2017-11-08 1.8

Added Order Classification field to Enter Order Message and Accepted Message.

2017-12-18 1.9Changed field names: Canceled Order Reason → Order Canceled Reason, Rejected Order Reason →Order Rejected Reason.
Changed message names: Accepted Message → Order Accepted Message, Replaced Message → Order
Replaced Message, Canceled Message → Order Canceled Message, AIQ Canceled Message → OrderAIQ Canceled Message, Executed Message → Order Executed Message, Rejected Message → Order
Rejected Message.

2019-02-21 1.10

Added Cash Margin Type field to Enter Order Message and Order Accepted Message.
Added “G” to Order Canceled Reasons and Order Rejected Reasons.

2019-07-10 1.11

Added Cash Margin Type values “2”, “3”, “4” and “5”.

2023-02-17 1.12

Changed Type of Orderbook Id to Alpha12