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

Re: ELA CODE -> DUNN'S NOISE TESTER



PureBytes Links

Trading Reference Links

At 5:11 PM -0400 10/7/98, Andy Dunn wrote:

>This comes from the Kaufman interview in S&C bonus issue 98. He talks
>about giving markets an efficiency ratio or rank and I guess this is used
>in chaos theory as "fractal efficiency". Anyways, there are 3 ways to
>calculate this theory....the one with the most detail is to take the
>"price change" over a period of time, and then divide that by the
>individual price changes over the same period. The ranking goes between 0
>and 1. There is less NOISE in the market and more efficiency as we
>approach 1, but if the mrket is wild and crazy, teh denominator swells and
>we approach 0. I believe Kaufman's theory is that it is much easy to trade
>trends in efficient markets and you can use shorter moving averages...but
>as markets get more volatile, you then logically have to use loser, or
>longer MAs. This indicator helps quantify the markets.
>
>I'm a butcher of a programmer so I can only figure out how to code this at
>a 10 day interval...perhaps Pierre or another top programmer would be so
>kind as to make the "extra cool" version that will allow either O,C, H,or
>L and any range of days rather than 10.


Below is my version of Kaufman's Efficiency Ratio.

Bob Fulks



{***********************************************************

Name : Efficiency Ratio Function

Notes: From "Smarter Trading" by Kaufman

Desc : Efficiency ratio is the ratio of total price excursion
       divided by the sum of all individual excursions of each
       bar. It equals 100 if all moves are in one direction
       over the lookback period.

By:    Bob Fulks based upon code and descriptions in
       Kaufman's book with:

        > Price input added



************************************************************}
Inputs:  Price(NumericSeries),          {Price which is averaged}
         Period(NumericSimple);         {Lookback period}

Vars  :  Noise(0),                      {Sum all individual excursions}
         Signal(0),                     {Total excursion over period}
         Diff(0),                       {Individual price excursions}
         EfRatio(0);                    {Efficiency Ratio}

Diff = AbsValue(Price - Price[1]);

if CurrentBar < Period then EfRatio = 0 else begin
   Signal  = AbsValue(Price - Price[Period]);
   Noise   = Summation(Diff, Period);
   EfRatio = IFF (Noise <> 0, Signal / Noise, 0);
end;

_Ef.Ratio = 100 * EfRatio;