Skip to main content
Sapinover - Click to go home

24-HOUR TRADING // FIX SESSIONS

When does a FIX sequence counter run out?

Every FIX message carries a sequence number, MsgSeqNum(34), that rises by one until the session resets. The protocol sets no maximum. Software does: many implementations store the counter as a signed 32-bit integer, which stops at 2,147,483,647. A daily reset has always emptied it long before then. Under 23/5 the reset moves to the weekend, and under 24/7 there may be none.

The calculator

Average over the hours the session is up. Count the busier side.

How the counter is stored

Max 2,147,483,647

Reset policy

Sunday 8 PM to Friday 8 PM ET

Survives

25 days

until the counter is full

1 day1 year1,000 years

The reset (white line) comes first, with 5.0x headroom. At this storage width the limit is about 4,971 messages a second.

Time to fill a signed 32-bit counter
Msgs/secTime to fillDaily / weekly / never reset
50497 daysok / ok / fails
100249 daysok / ok / fails
1,00025 daysok / ok / fails
5,0005.0 daysok / fails / fails
10,0002.5 daysok / fails / fails

The weakest link sets the limit

Widening the engine is not enough. The usable limit is the smallest counter anywhere a sequence number is stored, sent or parsed.

FIX engine
The counters for MsgSeqNum(34) and every field that carries a sequence number: BeginSeqNo(7), EndSeqNo(16), NewSeqNo(36), RefSeqNum(45), LastMsgSeqNumProcessed(369), NextExpectedMsgSeqNum(789).
Message store
Database columns and file indexes that hold sequence numbers. An int column caps the whole session even if the engine is 64-bit.
Drop copies and routers
Anything that re-emits, relays or matches on sequence numbers downstream.
Log parsers and monitoring
Tools that read sequence numbers back out of logs to spot gaps or alert on resets.
The other side
Your counterparty's engine and store. The limit is the smallest one anywhere on the path, on either side.

Two ways out

Widen to 64-bit, end to end

No downtime and no counter limit in practice, but every component on both sides has to change, and the change has to be tested across 2,147,483,647, including resends and gap fills. The long-term answer for true 24/7.

Reset while connected

A Logon with ResetSeqNumFlag(141)=Y restarts both sides at 1 without dropping the connection; NextExpectedMsgSeqNum(789) lets each side confirm what it has received. Works with today's software, but both sides must agree the procedure, and history before the reset can no longer be replayed.

Whichever you choose, agree it in the rules of engagement with each counterparty. There is no public census of who has moved to 64-bit, so ask rather than assume.

Sources