TimeStamps in milliseconds

4 messages Options
Embed this post
Permalink
rivercode

TimeStamps in milliseconds

Reply Threaded More More options
Print post
Permalink
Hi,

I am looking at the MySQL database and I see that in the table Trades you are using Type "DateTime" for "created_on" and "updated_on".  I am not a MySQL expert, but my understanding is that DateTime is limited to hh:mm:ss.

Since this platform is being designed for high frequency trading, how can you be using a timestamp without sub-seconds ?  The problem with something like this is that it would seem to be a fundamental design flaw, eg. I cannot get an accurate order and timestamp on orders sent and messages received.

Have I missed something ?  Because I cannot stress enough that if this is the same throughout the platform (eg. execution messages, etc) you will have problems in todays market where milliseconds count.

Thanks.
rivercode

Re: TimeStamps in milliseconds

Reply Threaded More More options
Print post
Permalink
Hi,

Well on further research it seems the problem is with a bug in MySQL...see

http://bugs.mysql.com/bug.php?id=8523

Apparently this will be fixed in version 6, but your high frequency trading users cannot wait for this to happen.

How to fix ? Here are some ideas, since I am not a MySQL/Java expert, please forgive if incorrect.

1. Immediate Fix without requiring code changes.  Add column called "MilliStamp" and value is created by trigger when there is an insert in the table. Use code from bug fix above (or other method) to create millisecond timestamp.  Since col value is generated by trigger on record insertion, this value will not be perfect BUT it is much better than nothing and then allows users to use the MiliStamp column to order their messages/fills/etc for sub-second intervals.  You should repeat this for every table where you have a Timestamp.

2.  Code Fix.  Amend code so that MilliStamp value is created at same time as TimeStamp. Requires more work, but will more accurate.

3. Long Term Fix. Will be taken care of when MySQL 6.0 ships.

Doing fix 1, in your 1.0 release will solve this problem in the short term...a little bit of a hack, but I cannot see any other way of quickly doing it...and it is critical for serious users to have this.

Thoughts ?

toli

Re: TimeStamps in milliseconds

Reply Threaded More More options
Print post
Permalink
Hi,

You bring up a very good point - this is something we should
definitely keep track of.

Can you do em a favor and file a JIRA issue at
http://www.marketcetera.org/jira as an RFE (request for improvement)
and we'll take a look at this?

thanks

On Fri, Nov 28, 2008 at 9:13 AM, rivercode <[hidden email]> wrote:

>
> Hi,
>
> Well on further research it seems the problem is with a bug in MySQL...see
>
> http://bugs.mysql.com/bug.php?id=8523
>
> Apparently this will be fixed in version 6, but your high frequency trading
> users cannot wait for this to happen.
>
> How to fix ? Here are some ideas, since I am not a MySQL/Java expert, please
> forgive if incorrect.
>
> 1. Immediate Fix without requiring code changes.  Add column called
> "MilliStamp" and value is created by trigger when there is an insert in the
> table. Use code from bug fix above (or other method) to create millisecond
> timestamp.  Since col value is generated by trigger on record insertion,
> this value will not be perfect BUT it is much better than nothing and then
> allows users to use the MiliStamp column to order their messages/fills/etc
> for sub-second intervals.  You should repeat this for every table where you
> have a Timestamp.
>
> 2.  Code Fix.  Amend code so that MilliStamp value is created at same time
> as TimeStamp. Requires more work, but will more accurate.
>
> 3. Long Term Fix. Will be taken care of when MySQL 6.0 ships.
>
> Doing fix 1, in your 1.0 release will solve this problem in the short
> term...a little bit of a hack, but I cannot see any other way of quickly
> doing it...and it is critical for serious users to have this.
>
> Thoughts ?
>
>
> --
> View this message in context: http://n2.nabble.com/TimeStamps-in-milliseconds-tp1589825p1589898.html
> Sent from the m-etc-dev mailing list archive at Nabble.com.
>
>
> _______________________________________________
> m-etc-dev mailing list
> [hidden email]
> http://lists.marketcetera.org/mailman/listinfo/m-etc-dev_lists.marketcetera.org
>



--
Toli Kuznets
http://www.marketcetera.com: Open-Source Trading Platform
download.run.trade.

_______________________________________________
m-etc-dev mailing list
[hidden email]
http://lists.marketcetera.org/mailman/listinfo/m-etc-dev_lists.marketcetera.org
rivercode

Re: TimeStamps in milliseconds

Reply Threaded More More options
Print post
Permalink
Hi,

JIRA issues Posted at https://www.marketcetera.org:8443/jira/browse/MTS-51


toli wrote:
Hi,

You bring up a very good point - this is something we should
definitely keep track of.

Can you do em a favor and file a JIRA issue at
http://www.marketcetera.org/jira as an RFE (request for improvement)
and we'll take a look at this?

thanks

On Fri, Nov 28, 2008 at 9:13 AM, rivercode <aquanyc@gmail.com> wrote:
>
> Hi,
>
> Well on further research it seems the problem is with a bug in MySQL...see
>
> http://bugs.mysql.com/bug.php?id=8523
>
> Apparently this will be fixed in version 6, but your high frequency trading
> users cannot wait for this to happen.
>
> How to fix ? Here are some ideas, since I am not a MySQL/Java expert, please
> forgive if incorrect.
>
> 1. Immediate Fix without requiring code changes.  Add column called
> "MilliStamp" and value is created by trigger when there is an insert in the
> table. Use code from bug fix above (or other method) to create millisecond
> timestamp.  Since col value is generated by trigger on record insertion,
> this value will not be perfect BUT it is much better than nothing and then
> allows users to use the MiliStamp column to order their messages/fills/etc
> for sub-second intervals.  You should repeat this for every table where you
> have a Timestamp.
>
> 2.  Code Fix.  Amend code so that MilliStamp value is created at same time
> as TimeStamp. Requires more work, but will more accurate.
>
> 3. Long Term Fix. Will be taken care of when MySQL 6.0 ships.
>
> Doing fix 1, in your 1.0 release will solve this problem in the short
> term...a little bit of a hack, but I cannot see any other way of quickly
> doing it...and it is critical for serious users to have this.
>
> Thoughts ?
>
>
> --
> View this message in context: http://n2.nabble.com/TimeStamps-in-milliseconds-tp1589825p1589898.html
> Sent from the m-etc-dev mailing list archive at Nabble.com.
>
>
> _______________________________________________
> m-etc-dev mailing list
> m-etc-dev@lists.marketcetera.org
> http://lists.marketcetera.org/mailman/listinfo/m-etc-dev_lists.marketcetera.org
>



--
Toli Kuznets
http://www.marketcetera.com: Open-Source Trading Platform
download.run.trade.

_______________________________________________
m-etc-dev mailing list
m-etc-dev@lists.marketcetera.org
http://lists.marketcetera.org/mailman/listinfo/m-etc-dev_lists.marketcetera.org