FIX internal sequence numbers

前端 未结 1 1643
醉梦人生
醉梦人生 2021-02-05 17:07

I have a process between the Sell side client and an exchange that does currency conversons. There are two FIX adapters - one recieving the messages from the sell side and servi

相关标签:
1条回答
  • 2021-02-05 17:48

    Any FIX application must maintain two sets of sequence numbers per session: the incoming and the outgoing. These sequence numbers are independent of each other.

    • Every time the app sends a message, it increments the outgoing sequence number and sets it in tag 34.
    • Every time the app receives a message, it increments the expected incoming number and makes sure the incoming message's tag 34 matches it.

    If you have two FIX sessions, then each session is tracking a pair of sequences.

    Often a provider will want to maintain sequence numbers between disconnects. This is especially important for order management connections, where, for example, you definitely want to know of any order fills that you missed if your connection went down for some reason.

    This is not so important for market data feeds. If your connection went down for a minute, you don't care what the price was while you were down -- you only need to know the latest price now. Therefore, the sequence resets on logon.

    However I don't understand the relation between tag 34 and the internal sequence numbers.

    This question sounds engine-specific. You haven't specified what engine you're using.

    But it shouldn't matter much. Every message you send should increment 34; the internal storage is used for this. Every message you receive should have 34 be 1 higher than the last; again, the internal storage is maintained so the app can track this.

    If you're using any of the QuickFIX engines, then you shouldn't have to worry about this. QF handles all this for you. (If you think you need to mess with the sequence number in QuickFIX, you're probably wrong. It's a common newbie question. Just set your config correctly and the engine will do the rest.)

    0 讨论(0)
提交回复
热议问题