3

QuickFIX has a configuration file where you set StartTime and EndTime. Unfortunately AFAIK QuickFIX only supports UTC for this configuration, whereas exchanges are often timezone dependent. This means that you need to remember to update this configuration file every time the clock changes.

Is there a way to set the StartTime \ EndTime parameters programatically instead of through the configuration file? That way you could adjust the timeset the correct values programatically.

Jonathan Livni
  • 101,334
  • 104
  • 266
  • 359

4 Answers4

4

There is a way to set this. You can can set a timezone as follows:

TimeZone=America/New_York

see the configuration guide.

It is weird that it is not in the quickfix configuration guide and it is present in the quickfixJ guide.

robthewolf
  • 7,343
  • 3
  • 29
  • 29
  • Are you sure this configuration is available on the vanilla QuickFIX? – Jonathan Livni Nov 06 '12 at 10:06
  • what is vanilla QuickFix? do you mean the C++ version? ie not quickfixJ. I do not know if its available. Have you tried it? There is the UseLocalTime option for sure but I am not sure that helps. its also available in quickfix/n http://quickfixn.org/tutorial/configuration – robthewolf Nov 06 '12 at 12:09
  • yes, I meant the C++ version which I use with python bindings. UseLocalTime would require setting the time to the server's time, which is less desirable than explicitly stating the timezone with the time. I'll check it manually... – Jonathan Livni Nov 06 '12 at 13:54
  • 2
    TimeZone does not work in C++. There is no such string in SessionSettings.h or any other part of the code. Therefore it will not work in Python either which binds to C++. UseLocalTime is provided which only works if your timezone changes to savings time the same as the server and requires changes to port between timezones. – CashCow Apr 05 '17 at 12:16
3

in our production environment we use always UTC times.

In the QuickFIX config file add for every counterparty the following line:

UseLocalTime=N

Please read the documentation here: http://www.quickfixengine.org/quickfix/doc/html/configuration.html#Session

stexcec
  • 1,143
  • 1
  • 18
  • 34
  • We do to, but as the exchange uses DST I rather not change the times manually every half a year. That is why I asked the question... – Jonathan Livni Nov 07 '12 at 14:16
  • @Jonathan, sorry for my wrong answer. As far as I know, the StartTime and EndTime are set only in the config file. BUT you can try to read the config file in a stream, modify the values and then load the stream into a SessionSettings object. – stexcec Nov 07 '12 at 14:42
  • 1
    I'm not sure how I do that via the Python bindings, but I may give it a shot – Jonathan Livni Nov 07 '12 at 14:50
1

as per quickfix docs you should add

set UseLocalTime=Y

Indicates StartTime and EndTime are expressed in localtime instead of UTC. Times in messages will still be set to UTC as this is required by the FIX specifications.

apapa
  • 669
  • 13
  • 22
0

We had an error

System.ArgumentException: Only UTC time is supported
Parameter name: oldtime
at QuickFix.SessionSchedule.IsNewSession(DateTime oldtime_utc, DateTime testtime_utc)
at QuickFix.Session.get_IsNewSession()

and the only way to fix it was to delete the store directory. Presumably the session timestamp like this

enter image description here

rupweb
  • 3,052
  • 1
  • 30
  • 57