# Pretty Good Oscillator

Pretty Good Oscillator is an indicator on [Vela](https://vela.luxalgo.com/chart), our next-generation charting platform, written in Pine Script®.

Expresses the close's distance from its 89-period simple moving average in units of smoothed true range, so stretch readings stay comparable across instruments and volatility regimes. Dashed thresholds at +3 and -3 frame the breakout reads of Johnson's original long-term system, with alerts on both threshold breaks and zero-line crosses in either direction.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Jul 19, 2026.
- Access: free.
- Concepts: [Pretty Good Oscillator](https://www.luxalgo.com/library/concept/pretty-good-oscillator/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=mz5952zsteddo1z9s0xa5oq2
- Page: https://www.luxalgo.com/library/indicator/pretty-good-oscillator/

**Pretty Good Oscillator** answers one question in portable units: how far has the close traveled from its own average, measured in typical bar ranges? The build follows the original recipe for the [Pretty Good Oscillator](https://www.luxalgo.com/library/concept/pretty-good-oscillator/) (source minus its simple moving average, divided by a smoothed true range of the same length), so a reading of +3 means price sits about three average bars above its baseline on any instrument. The PGO line colors by sign, with a gradient fill to zero and dashed threshold lines.

## How to Trade the Pretty Good Oscillator?

- **Cross above the Upper Threshold (+3)**: displacement has reached the territory Johnson's long-term system treated as an upside breakout; the Bullish Breakout alert marks it.
- **Cross below the Lower Threshold (-3)**: the mirrored downside condition, covered by the Bearish Breakout alert.
- **Zero crosses**: the source moved back through its baseline, the slower trend-side read, with alerts both ways.

Because the denominator is a true-range average, the thresholds keep one meaning whether the tape is quiet or wild, the reason to prefer it over a raw distance-from-average plot.

## Pretty Good Oscillator Settings

- **Length** (default 89): lookback for both the baseline and the smoothed true range. The default is Johnson's long-term setting; dropping to 14 or 21 speeds the line up and adds noise.
- **Source** (default close): the series measured against its baseline.
- **True Range Smoothing** (default EMA): average type in the denominator; SMA is the variant, with modestly different readings.
- **Upper Threshold** (default 3) and **Lower Threshold** (default -3): the breakout levels, in smoothed true-range units. Shorter lengths usually pair with tighter values.
- **Gradient Fill** (default on) plus bullish, bearish and level colors.

## Frequently Asked Questions

### How is PGO different from Bollinger %B?

Both normalize price's stretch, but with different rulers. [Bollinger Bands](https://www.luxalgo.com/library/indicator/bollinger-bands/) measure it in standard deviations of the close, which ignore intrabar range and gaps; PGO divides by averaged true range, so gap-heavy or wide-ranging bars widen its denominator. The two agree often and disagree exactly when bar shape matters.

### Why is the default length 89?

It is the length from Johnson's long-term formulation, applied to both the baseline and the true-range average. Nothing in the math privileges it. Shorter-horizon traders commonly drop to 14 or 21 and tighten thresholds to match.

### Is the oscillator bounded?

No. Readings beyond the thresholds simply mark increasingly unusual extension. Whether that argues for joining the move or fading it is a strategy decision the indicator deliberately leaves open.

## Related indicators

- [Internal Candle Strength](https://www.luxalgo.com/library/indicator/internal-candle-strength/) (Balance of Power): markdown at https://www.luxalgo.com/library/indicator/internal-candle-strength.md
- [Gator Oscillator](https://www.luxalgo.com/library/indicator/gator-oscillator/) (Momentum & Oscillators): markdown at https://www.luxalgo.com/library/indicator/gator-oscillator.md
- [Wave Trend Oscillator](https://www.luxalgo.com/library/indicator/wave-trend-oscillator/) (Momentum & Oscillators): markdown at https://www.luxalgo.com/library/indicator/wave-trend-oscillator.md
- [Traders Dynamic Index](https://www.luxalgo.com/library/indicator/traders-dynamic-index/) (Momentum & Oscillators): markdown at https://www.luxalgo.com/library/indicator/traders-dynamic-index.md
- [Center of Gravity](https://www.luxalgo.com/library/indicator/center-of-gravity/) (Momentum & Oscillators): markdown at https://www.luxalgo.com/library/indicator/center-of-gravity.md
- [QQE Weighted Oscillator](https://www.luxalgo.com/library/indicator/qqe-weighted-oscillator/) (QQE): markdown at https://www.luxalgo.com/library/indicator/qqe-weighted-oscillator.md
- [5/35 Oscillator](https://www.luxalgo.com/library/indicator/5-35-oscillator/) (Momentum & Oscillators): markdown at https://www.luxalgo.com/library/indicator/5-35-oscillator.md
- [Inverse Fisher Transform](https://www.luxalgo.com/library/indicator/inverse-fisher-transform/) (Momentum & Oscillators): markdown at https://www.luxalgo.com/library/indicator/inverse-fisher-transform.md

---

Source: https://www.luxalgo.com/library/indicator/pretty-good-oscillator/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
