[ts-gen] How to widen decimal database attributes

Bill Pippin pippin at owlriver.net
Tue Sep 29 14:22:24 EDT 2009


Ken,

Let me thank you for raising the issue of fractional data
representation in the database from the perspective of a currency
trader.

I've reconsidered my earlier post, and now feel that the correct
solution is to change decimal(10,4) attributes to double in the
database create tables sources.

This is the classic and correct solution; relatively small fractional
quantities may be declared as decimal, while larger ones should be
double.

It also saves me support headaches, in explaining to users such as
yourself that you're expected to modify the create table statement
sources and recreate the database, and most critically from my
standpoint, eliminates any confusion about where loss-of-precision
problems come from: they're either due to the shim's input, or else
internal to the shim.

In theory decimals have the advantage that query conditions may test
for equality, e.g., when selecting orders by limit or aux price.  In
practice, I see no significant problem in using intervals, and so
view this as a non-issue.

Unless there is significant, well-reasoned, and timely opposition
from the list, this change will take effect with the next release,
later this week, and possibly tomorrow, since I would like to get
one more release out this month.
 
Thanks,

Bill


More information about the ts-general mailing list