Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating DateTimeConverter to be able to convert between microseconds #425

Merged
merged 6 commits into from Aug 28, 2017

Conversation

huwmjenkins
Copy link
Contributor

This provides some basic support for Microsecond parsing. The Issue 352 talks about nano-seconds but that would be more complicated. I introduced a new enum for users to specify what level time formatting they want (second, millisecond, microsecond). The existing interface should behave exactly as they did before as they convert the boolean to the relevant value of the above enum and then call the new method that takes this as a parameter.

and adding extra constructor to the DateTime Fields to allow the precision to be passed
@ablaagaard
Copy link

Hi, What is the status of this Pull Request - has it just been abandoned?

@f2santos
Copy link

Hi. Does this means that nanoseconds will not be implemented or that it take longer?

Best regards

@huwmjenkins
Copy link
Contributor Author

The problem is that QuickFixN currently uses the .net DateTime object for all it's parsing of Date/Times. The System.DateTime structure only has a precision to 100-nanoseconds (https://msdn.microsoft.com/en-us/library/system.datetime%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396). This means that to support nanosecond precision, QuickFixN would have to use an alternate means to parse and store Date/Time values(for instance, Jon Skeet's NodaTime project might be useful to resolve this or a custom built solution). I do not know how the owners of this project would want to proceed with such a change and as it is not a requirement of mine I have not spent any time looking at the problem.

@cbusbey
Copy link
Contributor

cbusbey commented Aug 23, 2017

#352 is becoming a critical issue for those that need to comply with MiiFID 2. What this pr does to help this issue

  • Extends the datetime field to allow parsing and serializing to seconds, milliseconds, microseconds resolution (the latter being the new feature)

Critically, what this pr does not do to address potential MiiFID2 requirements

  • Nanoseconds resolution
  • No config option to use higher resolution timestamps for sending time, orig sending time

For reference, QuickFIX/j and QuickFIX/Go have an implementation that addresses these last two bullet points.

Given the above, is there still value in merging this pr, or could it be used as a POC for a more complete implementation?

@huwmjenkins
Copy link
Contributor Author

I've updated the pull request and added new session property called:

TimeStampPrecision

this can set to:

Second
Millisecond
Microsecond

and will set the SendingTime and OrigSendingTime to the appropriate precision.

The existing MillisecondsInTimeStamp property can still be used, it just sets the above property to either Second or Millisecond depending on whether it is N or Y. However, the value of TimeStampPrecision will take precendence if both properties are present.

@cbusbey cbusbey merged commit 9b27f25 into connamara:master Aug 28, 2017
@cbusbey
Copy link
Contributor

cbusbey commented Aug 28, 2017

🍻 Thanks @huwmongoose !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants