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

Re: Speaking of volatility



PureBytes Links

Trading Reference Links

At 8:40 AM -0700 8/19/01, Thomas Alexander wrote:

>{This code calculates an Open/High/Low/Close volatility as described by Rodgers
>and Satchell}

Very interesting calculation. I am still studying it but could not
resist reporting one issue I discovered.

I simplified the equations a bit by factoring, etc., to better see
what the code was doing and the resulting modified version, although
identical mathematically, gave significantly different results on
several bars.

I traced this to the famous TradeStation precision issue. At one bar,
for example, the code took the difference between two numbers very
near 50 and the result were:

   the original code        0.00000418834
   the factored version     0.00000038109

The final volatility for that bar in each case was:

   0.002065890
   0.000633517

The differences are because the factoring I did made the precision
errors different in the two cases. So if you use the indicator in
TradeStation, you might like to do some numerical analysis first...

This is NOT the fault of the code Thomas Alexander posted. That is
fine. The problem is with TradeStation's use of single precision
floating point arithmetic as we recently discussed ad nauseam.

As we said then, you never know when it will bite you...

Bob Fulks