Triple Timeframe Divergence Confluence
A single-timeframe divergence signal is cheap to find and, on its own, not particularly reliable - RSI divergence on a five-minute chart appears constantly and means comparatively little. This indicator raises the bar by voting: it independently searches for the most recent regular divergence (price extreme not confirmed by RSI) on the chart's own timeframe plus two configurable higher ones, and only marks a confluence signal when at least two of the three currently agree on direction. Agreement requires more than matching direction. Each timeframe's divergence also has to be recent IN THAT TIMEFRAME's OWN bars (InpMaxAgeBars) to count as "still active" - a bullish divergence found on the daily chart three weeks ago is not allowed to be paired with a fresh one on the hourly chart and counted as confirmation just because both are technically "bullish". Only divergences that are all still live at the same moment can vote together. Signal count drops sharply compared to a single-timeframe divergence tool - that is the intended trade. What remains has survived a cross-timeframe check rather than reflecting one oscillator's opinion on one chart. RSI is read with the built-in iRSI() on each timeframe directly (no iCustom, no fixed-argument limitation to work around), so every vote uses the exact same, unmodified RSI definition. Notes and limitations - Only regular divergence is voted on here - hidden divergence is a different pattern with a different meaning and is deliberately excluded from the vote. - Each timeframe's scan only looks for its single MOST RECENT completed divergence, not every divergence in the scan window - this keeps three timeframes' worth of pivot scanning affordable on every new bar, at the cost of not surfacing an older, still-arguably-relevant divergence that has since been superseded by a fresher, contradictory one on the same timeframe. - "Recency" is measured in each timeframe's own bars, which are not directly comparable in wall-clock time across timeframes by design - InpMaxAgeBars = 20 means 20 H1 bars on the H1 vote and 20 H4 bars (80 hours) on the H4 vote. - Does not repaint already-confirmed pivots on any timeframe.
Indicator · MT5 · v1.0 · Free
About Triple Timeframe Divergence Confluence
Triple Timeframe Divergence Confluence is an indicator for MetaTrader 5 based on Divergence and RSI. It draws buy and sell arrows on the chart and can alert you with a pop-up, sound, email or push message. It has 7 settings, such as Timeframe2, Timeframe3 and Rsi period. MQL source code included.
Files in the download: TripleTimeframeDivergence.ex5, TripleTimeframeDivergence.mq5, TripleTimeframeDivergence.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Timeframe2 | PERIOD_H1 | Second timeframe voted on |
| Timeframe3 | PERIOD_H4 | Third timeframe voted on |
| Rsi period | 14 | RSI period on every timeframe |
| Pivot bars | 5 | Bars required on each side to confirm a swing pivot |
| Scan bars | 150 | How many bars back each timeframe searches for its latest divergence |
| Max age bars | 20 | A timeframe's divergence must have completed within this many of ITS OWN bars to count as "still act |
| Alerts | true | Alert once when a new 2-of-3 confluence confirms |
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: RSI · Divergence · Buy/Sell Arrows · Alerts · MT5 Indicator · MQL5 Source Code