Pretty Good Oscillator
Most "distance from the moving average" tools plot the raw price gap in points or pips, which makes readings meaningless across instruments - twenty pips is nothing on Gold and a lot on a quiet JPY cross. The Pretty Good Oscillator fixes this the simple way: divide that gap by the average true range over the same window, so the reading is expressed in units of the instrument's own recent volatility instead of in price. A PGO reading near +3 or beyond is the published rule-of-thumb threshold for "price has broken meaningfully away from its own average, relative to how much it normally moves" - the level lines at +3, 0 and -3 mark this. It is a breakout/extension gauge, not a mean-reversion or trend-following signal by itself; what you do with a stretched reading (fade it, ride it, ignore it) is a strategy decision this indicator deliberately leaves alone. The ATR here is MetaTrader's built-in iATR, which uses Wilder's smoothing rather than a plain arithmetic average of true range. Some published descriptions of PGO use a plain SMA-based average true range instead; the two will produce very slightly different readings on the same data, close enough in practice not to matter for the threshold-crossing behaviour the oscillator is used for, but worth knowing if you are checking this against a source that used a different ATR method. Notes and limitations - Needs at least InpPeriod + 1 bars of history before it plots. - Uses Wilder-smoothed ATR (iATR) rather than a plain SMA-based average true range - see above. - Purely a distance/stretch gauge; it does not predict direction of the next move and issues no alerts.
Indicator · MT5 · v1.0 · Free
About Pretty Good Oscillator
Pretty Good Oscillator is an indicator for MetaTrader 5 based on Moving Average and ATR. It has 1 setting, such as Period. MQL source code included.
Files in the download: PrettyGoodOscillator.ex5, PrettyGoodOscillator.mq5, PrettyGoodOscillator.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Period | 14 | Lookback for both the SMA and the ATR |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the indicator from the Navigator onto a chart and adjust the settings.
Tags: Gold (XAUUSD) · Breakout · Moving Average · ATR · Oscillator · MT5 Indicator · MQL5 Source Code