Take the 2-minute tour ×
Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. It's 100% free, no registration required.

I am trying to achieve the following functionality using QuickFIX for FIX 4.2

  1. Send a couple of orders and make sure they’re filled.
  2. Then disconnect.
  3. Change the incoming (from Broker) sequence number to a lower number. Example if it is 300 i now change it to 260.
  4. Log back in.
  5. My Application should detect the sequence number from Broker, as lower than what is expected and my side should automatically send a type 2 (resend request) message to Broker.
  6. Broker will gap fill/send missing data.

At the moment when i attempt the step 3 (i.e change to sequence number from broker to a lower value) and then attempt to login, my applications logs out immediately with the error message the MsgSeqNum is lower than what is expected.

I am familiar with the ResetSequenceNumFlag, ResetOnLogon, ResetOnLogout flags but they don't seem to be the right choice for the above procedure.

share|improve this question
    
You're supposed to reset your sequence number, not the exchange's. If the counter-party sequence number is wrong, then you will definitely get an error. –  chrisaycock Apr 30 '12 at 12:44
    
Sounds like this is really a question about QuickFix, and not FIX in general. Can you show us the error message? –  windfinder May 2 '12 at 18:39
    
Below is the error message i get while QuickFix logs out my application: 20120503-07:19:08.551 : ^8=FIX.4.2^9=115^35=5^34=11^49=***^50=******^52=20120503-07:19:08.550^56=*********^58=MsgSeqNum too low, expecting 9 but received 1^10=211 –  Taimoor Choudhary May 3 '12 at 7:21
    
Are you using QuickFix/j? –  user3151 Oct 24 '12 at 10:06
add comment

2 Answers

Are you sure there is a practical use case behind this (especially step #3). Brokers don't switch sequence number back in the middle of the session. If you absolutely need to support this use Sesssion.setNextTargetMsgSeqNum() API

share|improve this answer
    
Yes you are right about Brokers switching the sequence number back. But the above steps are required by the Broker to complete there certification. –  Taimoor Choudhary May 4 '12 at 7:36
    
Also i tried Sesssion.setNextTargetMsgSeqNum() but "setNextTargetMsgSeqNum()" or anything similar to it is not available. I am using QuickFIX/n –  Taimoor Choudhary May 4 '12 at 16:32
add comment
up vote 2 down vote accepted

I am using QuickFIX/n, initially there were no methods to change the sequence number but we requested the QuickFIX/n developer community for adding methods to change the sequence numbers and in the later builds Session.NextTargetMsgSeqNum and Session.NextSenderMsgSeqNum were added to change the sequence number.

And i was able to easily change the sequence numbers according to my requirements using the methods Session.NextTargetMsgSeqNum and Session.NextSenderMsgSeqNum.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.