Divergence Quality Scorer
A standard divergence indicator paints the same arrow whether RSI drifted down by one point over forty choppy bars or dropped fifteen points in five clean ones - both get flagged, and there is no way to tell from the chart alone which is the stronger signal. This indicator scores every confirmed divergence on three separate qualities and averages them into one 0-100 number, printed as text next to the divergence line: Swing size measures how large the price move actually was, expressed in ATR units and capped at three times ATR - a divergence built on a genuinely large swing scores higher than one built on a marginal wiggle. Angle separation measures how sharply the RSI slope disagrees with the price slope between the two pivots, converting both into comparable angles before comparing them - a divergence where RSI is clearly moving the opposite way scores higher than one where RSI is nearly flat while price merely inches to a new extreme. Cleanliness measures how closely price actually tracked a straight line between the two pivots, rather than chopping back and forth around it - a divergence built on two clean touches scores higher than one built on two pivots that happen to be the extremes of a messy, whipsawing range. The result replaces a binary "divergence / no divergence" arrow with a ranked signal a trader can filter on - set InpMinScore to suppress everything below a chosen quality bar rather than manually judging each arrow by eye. Notes and limitations - The three sub-scores are a documented, from-scratch scoring method, not a published or peer-reviewed standard - treat the 0-100 number as a consistent relative ranking between divergences on the same chart, not an absolute probability of a successful reversal. - Angle separation compares normalised slopes (price in ATR units per bar, RSI in 25-point units per bar) rather than true chart-pixel angles, which keeps the score independent of the chart's current zoom level. - Pivots are confirmed fractal-style, so a divergence is never revised or withdrawn once drawn - it can only move from "not yet confirmed" to "confirmed". - Does not repaint - each bar's RSI and score only ever use data at or before it.
Indicator · MT4 · v1.0 · Free
About Divergence Quality Scorer
Divergence Quality Scorer is an indicator for MetaTrader 4 based on Divergence, RSI and ATR. It draws buy and sell arrows on the chart and can alert you with a pop-up, sound, email or push message. It has 5 settings, such as Rsi period, Atr period and Pivot bars. MQL source code included.
Files in the download: DivergenceQualityScorer.ex4, DivergenceQualityScorer.mq4, DivergenceQualityScorer.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Rsi period | 14 | RSI period |
| Atr period | 14 | ATR period used to normalise swing size |
| Pivot bars | 3 | Bars required on each side to confirm a swing pivot |
| Min score | 0 | Suppress the label/line for scores below this (0 shows everything) |
| Alerts | true | Alert once when a new divergence confirms |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 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: RSI · Divergence · Buy/Sell Arrows · Alerts · ATR · MT4 Indicator · MQL4 Source Code