QuickFIX what are StartTime and EndTime settings supposed to do?
Asked Answered
C

2

14

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?

Cogitative answered 12/1, 2016 at 6:15 Comment(4)
Did you specify your times in UTC? When you say it doesn't send Logon, how are you checking that? Have you checked for anomalies in your event/message logs?Goofy
Yes , I checked the event and message log. I set the UseLocalTime=Y, so I used local time in StartTime and EndTimeCogitative
Alright, look like the UseLocalTime setting is not working. I used UTC and it work now. Thanks allCogitative
Don't use LocalTime. Use UTC time.Unhand
G
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.

Goofy answered 12/1, 2016 at 14:52 Comment(6)
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.Unhand
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.)Goofy
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.Cogitative
Alright, look like the UseLocalTime setting is not working. I used UTC and it work now. Thanks allCogitative
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.Unhand
@TT QuickFIX always resets sequence numbers for a new session. That's what defines it being a new sessionCartoon
C
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.

Cogitative answered 13/1, 2016 at 5:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.