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

Re: AW: TradeStation Precision - Summary



PureBytes Links

Trading Reference Links

At 6:42 AM -0800 7/30/01, Rich Estrem wrote:

>run on TS Pro:
>
>200-bar EMA as suggested by Mike below, run on 1 min $INDU data:
>
>ending value run on 1360 bars   = 10417.33
>ending value run on 54,206 bars = 10417.33
>
>(excel result on 1567 bars      = 10417.33)
>
>I don't doubt that some calc's do lose precision over multiple
>iterations in TS, but clearly the EMA is not a good example to show
>this problem.


At 6:43 AM -0700 7/30/01, Jack Griffin wrote:

>People this should be obvious --- the ema
>automatically eliminates any cumulative errors due to
>the what is it.  The SMA, DMI, OBV, ect. is where this
>type of thing shows up.

To add more detail to Jack's point, the EMA will not show this affect
because it does not accumulate the error even though it seems as if
it should:

Its equation is:

   XAverage = Factor * Price + (1 - Factor) * XAverage[1]

So with values:  Price  = 10000.000  Factor = 0.01000000

   XAverage = 0.01000000 * 10000.000 + 0.99 * 10000.000

   Max      = 100.00001 + 9900.001  = 10000.001
   Nominal  = 100.00000 + 9900.000  = 10000.000
   Min      =  99.99999 + 9899.999  =  9999.999

So the error will be randomly in the 7th significant digit -
sometimes plus and sometime minus - and gets attenuated by
(1 - Factor) so does not accumulate.

A better example is the simple moving average version that
accumulates the value form bar to bar. It appears to be called
"Average(series)" in TS4.0 and "AverageFC" in TS2000i.

It contain the term:

    Sum = Sum[1] + Price - Price[Length];

In this case the errors accumulate without attenuation.

I ran a quick test and see errors of about 0.1 in about 9000 bars of
INDU with a Length of 124. That is about 100 times the one part in
10^7 error on a single calculation and just about at the point where
it might start becoming important. (The error depends a lot on the
number of bars and the Length since it is the sum of random round-off
errors each of near 1 part on 10^7.)

As Jack said, the errors accumulate in functions such as SMA, DMI,
OBV, etc., that accumulate a sum without attenuation. Lots of
functions do this including common ones such as RSI.

The error will grow much faster in functions that subtract two near
equal values as I have pointed out before. Statistical functions such
as LinearRegValue and LinearRegValue subtract two near equal large
numbers, for example.

Bob Fulks