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

Re: PGO Code?



PureBytes Links

Trading Reference Links

Ross,

>  Does anyone have the code for the old PGO (Pretty Good Oscillator)?
>
>  Been through the FTP at TradeStation and it doesn't appear to be
>  there. Just curious is all.

I remember that.  Mark Johnson had deliberately obfuscated it with
bizarre formulas like Tangent(.022199645) and sums of Fibonacci
constants.  After poring through it a while, one discovers that the
whole thing reduces to one line of code!  Mark confirmed to me that
I had figured out the puzzle.

PGO = (close - average(close, length)) / xAverage(TrueRange, length);

...where length=89 in Mark's version.  If you don't believe they're
the same, plot the original code (if you have it, I don't anymore)
against the 1-line version.

After distilling it down to one line, you can see what's going
on.  PGO measures the price velocity against the daily noise,
expressing the measurement as a ratio.  There are several ways to
measure velocity.  Instead of close-average(close,N), one might
use momentum.  Also one could measure daily noise differently; for
example substitute the xAverage(TrueRange,N) with AvgTrueRange(N)
and it would still work about the same.

-- 
  ,|___    Alex Matulich -- alex@xxxxxxxxxxxxxx
 // +__>   Director of Research and Development
 //  \ 
 // __)    Unicorn Research Corporation -- http://unicorn.us.com