13

I'm trying to understand the StartTime and EndTime setting in the QuickFIX config file. I'm using QuickFIX .Net to implement a buy side FIX client, set as a initiator.

By default , both StartTime and EndTime set to 00:00:00

So every time my program run (it calls initiator.start()) , it auto send Logon message to server. No problem.

And then I play around the StartTime and EndTime setting. Not much details about it in the QuickFIX doc. I suppose when I run the program , and application will send Logon message at StartTime, and Logout at EndTime isn't it?

So I set the StartTime and EndTime to say 10:00 and 11:00

I started the program at 09:50, the program just created the session and doesn't send Logon message. Make sense. Then at 10:00, nothing happened...

Next trial I started the program at 10:50, the program created the session and logon as usual. Than at 11:00 , nothing happened again. I suppose it will auto logout...

So my question is how are StartTime and EndTime supposed to affect my program?

Andrew Brēza
  • 7,705
  • 3
  • 34
  • 40
Jason Chan
  • 305
  • 2
  • 13

2 Answers2

10

From the docs:

  • ID: StartTime

    • Description: Time of day that this FIX session becomes activated
    • Valid Values: time in the format of HH:MM:SS, time is represented in UTC
  • ID: EndTime

    • Description: Time of day that this FIX session becomes deactivated
    • Valid Values: time in the format of HH:MM:SS, time is represented in UTC

So, yes, you have it roughly right. At StartTime, your app will attempt to log on. At EndTime, it will logoff. Between those times, it will continually try to reconnect.

Not mentioned is that this time window determines when your sequence numbers will reset. At StartTime, the engine will reset sequence numbers back to 0. For this reason, it's vitally important that your StartTime/EndTime be in sync with your counterparty.

Grant Birchmeier
  • 17,809
  • 11
  • 63
  • 98
  • AFAICT sequence numbers are reset by using `ResetOnLogon`, `ResetOnLogout`, `ResetOnDisconnect` and `ForceResync` configuration options (with default values of No). Your last sentence seems to suggest otherwise. – TT. Jan 12 '16 at 17:32
  • We're both right. Some counterparties want seqnums to be reset on every single reconnect, regardless of session start/end times. These settings enable such behavior. (I don't honestly know why there is a need for 3 separate `ResetOnX` settings; seems to me like `ResetOnLogon` is enough.) – Grant Birchmeier Jan 12 '16 at 20:30
  • Here is my config [DEFAULT] ConnectionType=initiator ReconnectInterval=60 FileStorePath=store FileLogPath=log UseLocalTime=Y StartTime=09:33:00 EndTime=09:40:00 UseDataDictionary=Y DataDictionary=C:/quickfix/spec/FIX42.xml HttpAcceptPort=9911 This was 09:32 local time (UTC +8) here I started the program, it have following in log 20160113-01:32:15.549 : Created session So now the time passed 09:35, nothing happened, nothing in log. – Jason Chan Jan 13 '16 at 01:33
  • Alright, look like the UseLocalTime setting is not working. I used UTC and it work now. Thanks all – Jason Chan Jan 13 '16 at 01:43
  • I understand what you are saying, but unless you set either `ResetOnLogon` or `ResetOnLogout` to `Y`, the QuickFIX engine will not reset the sequence number no matter what the counterparty does. – TT. Jan 13 '16 at 07:09
  • @TT QuickFIX always resets sequence numbers for a new session. That's what defines it being a new session – Ben Aaronson Feb 19 '16 at 14:03
2

Found out the old QuickFix/n library have bug on the UseLocalTime setting. I rebuilt my program with the latest v1.5 it works as expected.

Jason Chan
  • 305
  • 2
  • 13