A divergence happens when price makes a new high but the oscillator does not (or price makes a new low and the oscillator does not). Many divergence indicators look perfect on old charts and disappoint in real time, for two reasons: they draw the signal back on the swing although the swing was only known some bars later, and they delete or move signals when new bars come. This indicator is built so that what you see on an old chart is exactly what you would have seen in real time.
What is drawn
The four kinds
Regular divergences are on by default, hidden ones can be switched on.
No repaint
Checks against false divergences
For Expert Advisors (5 buffers)
0 the oscillator, 1 regular bullish, 2 regular bearish, 3 hidden bullish, 4 hidden bearish. Buffers 1 to 4 hold a value only on the bar where that divergence was confirmed. Read bar 1 (the last closed bar): if the buffer is not EMPTY_VALUE, a divergence was confirmed there.
When you call the indicator with iCustom, each "input group" counts as one parameter: pass a string for it, for example iCustom(_Symbol, _Period, "DivergenceNoRepaint", "Oscillator", 0, 14, 12, 26, 9, ...).
Inputs: oscillator and its periods, price source, bars to the left and to the right of a swing, minimum and maximum distance, alignment of the swings, earlier swings to compare, regular / hidden, zone filter, bars to calculate, lines and arrows on the price chart, two colours, alerts (pop-up and push).
How it was tested
A divergence is a sign that a move is losing strength, not a trading system by itself. Use it together with your own levels, trend and risk rules.
Key Levels: PDH/PDL, weekly and monthly levels, midnight open, Asian range, sweeps
Previous day, week and month high and low, New York midnight open, period opens and the Asian range, with sweep marks and one alert per level. Day from broker or New York time. No repaint, buffers for EAs.
OrderGuard - restart-safe order sending for EAs (no duplicate trades)
An include file that makes the way an EA sends its orders safe: the same signal is never traded twice. It has no trading strategy inside and comes with a small example EA.
StrictJson: RFC 8259 JSON parser and writer for MQL5
One include file that reads and writes JSON in MQL5 and MQL4. It refuses broken JSON and tells you the line and column of the mistake, keeps numbers exact, reads and writes UTF-8 files, and saves your EA's settings to a file and loads them back.
Currency Strength Free MT5 - Eight Currency Scanner
Free MT5 dashboard comparing eight major-currency strengths and ranking up to 28 FX pairs from completed candles. Includes broker-prefix/suffix detection, synchronization checks, chart navigation and eight output buffers. Independent MIT-licensed source; no trading operations.