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.
Accelerator Oscillator (AC)
The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.
MACD Signals
Indicator edition for new platform.