[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Special thread for Pierre Orphelin, the man who do not want to see



PureBytes Links

Trading Reference Links

> This is what i learn while looking on TS 4.0  DDE protocol -
> there is all quote (chart) data  represented
> with WORDS (2bytes - 16bit) only data!!!
> also they use special parameter, which mean there decimal point
> should be located,

Yes.  The Server stores all data points as a 16-bit offset from the 
FIRST QUOTE of the day, using the PriceScale as the "special 
parameter" to scale it.

So each price you see on your screen is calculated as:

  Price = FirstQuoteOfDay + PriceScale * 16BitOffset

> All is ok, until special cases like that you showed below. :)
> that is that at 5th significant digit sometimes numbers are lost.

That's not what Mats is seeing.  He's seeing roundoff errors in 
single-precision FLOAT variables.

The price representation that Omega uses saves lots of room in the 
database, but it causes problems if a market starts to move a lot 
more than it used to.  For example, the INDU and the NDX/ND symbols 
have a PriceScale of 1/100 in the default symbol universe.  That 
worked fine until those markets started moving more than 327.67 
points in a day.  A 16-bit value can represent numbers from -32767 to 
+32768, so 1/100 * 32767 gives a limit of 327.67 offset from the 
opening price.  You have to change the PriceScale on those symbols to 
1/10 to handle the wider range.  This means you lose a digit of 
precision after the decimal point (the price is now XXX.X instead of 
XXX.XX) but you won't have garbage data on large-range days.

Gary