Timeframe Divergence Monitor
- Индикаторы
- Версия: 1.0
- Активации: 5
# Timeframe Divergence Monitor - When horizons disagree
*Category: Multi Timeframe Hybrids | Difficulty: intermediate | Window: separate window below the chart | Markets: Universal (Forex, indices, commodities, crypto, stocks) | Suggested timeframes: M5, M15, M30, H1, H4*
## Short description
> Measures the momentum disagreement between current and higher timeframes, highlighting phases where the two horizons move in opposite directions.
## Full description
### Overview
When the current timeframe and the higher one tell opposite stories, one of them is wrong. Knowing which is impossible in advance, but knowing the disagreement exists is already information that should change how you trade. Disagreement phases are the most dangerous for directional strategies: the operating timeframe signal is continually contradicted by the higher one, positions are closed at a loss by moves that look inexplicable on the small chart, and the trader ends up blaming themselves for errors that are actually structural. This indicator measures normalised momentum on both horizons and shows their difference, colouring it only when the two genuinely have opposite signs. Recognising the disagreement at least allows reducing exposure instead of suffering it without understanding the cause.
### How the calculation works
1. On the current timeframe momentum is computed as the close change, normalised by its own ATR.
2. On the higher timeframe the same is done, but using exclusively already closed bars.
3. Each momentum is normalised by the ATR of its own timeframe, so the two values are comparable.
4. The divergence is the difference between the two normalised momentum values.
5. The histogram is coloured only when the two momentum values genuinely have opposite signs.
6. A difference between two agreeing values is merely a matter of degree and describes no disagreement.
### How to use it
- Reduce exposure or stay out during coloured phases: those are where directional strategies suffer most.
- Read the two lines to see which one is leading: the gold higher timeframe one is the most important.
- A divergence closing with the current aligning to the higher signals the end of the pullback.
- A divergence closing with the higher giving way instead signals a deeper regime change.
- A grey histogram indicates agreeing horizons: those are the phases where directional strategies pay best.
### Who it is for and on which timeframes
It targets traders working low timeframes who cannot understand why sometimes everything works and sometimes nothing does. It works from M5 to H4. It produces no entry signals and is exclusively a defensive tool: it says when not to trade, information less eye-catching but often more profitable than one more signal. It should be paired with an existing strategy as a filter, not used in isolation.
### Practical example of reading a signal
A trader works M15 with a continuation strategy and gets excellent results for three days. Then for two days they lose on almost every trade, with no change in method. The indicator shows that over those two days the histogram was constantly coloured: M15 momentum was bullish while H4 momentum was bearish, so every upward continuation signal was contradicted by the higher structure. It was neither an execution nor a method problem: it was a phase in which that strategy, by construction, could not work. Recognising it in advance, the trader would simply have cut position size.
## Input parameters
| Parameter | Default | Description |
|---|---|---|
| `InpHigherTf` | PERIOD_CURRENT | Higher timeframe to compare against. With the default value a sensible multiple is chosen automatically. |
| `InpMomPeriod` | 14 | Momentum horizon, applied homogeneously on both timeframes. |
| `InpAtrPeriod` | 30 | ATR period used to normalise momentum on each timeframe. |
| `InpDivLevel` | 1.20 | Divergence beyond which the disagreement is deemed relevant and the histogram coloured. |
## Advantages / strengths
- It explains a real and frequent difficulty most traders wrongly attribute to their own mistakes.
- It colours only genuine disagreements, those with opposite signs, not mere differences of degree.
- Both momentum values are normalised by their own ATR, so the comparison is methodologically sound.
- No repaint: on the higher timeframe it uses exclusively closed bars.
## Limitations and warnings
- It does not say which of the two horizons is right, the most valuable information but not obtainable.
- It produces no entry signals: used in isolation it is unusable.
- The higher timeframe lag means the disagreement is recognised a few bars late.
- In transition phases both momentum values keep changing sign and the histogram becomes hard to read.
**No repaint:** values printed on a closed bar are never modified afterwards.
**Disclaimer.** This product is a technical analysis tool, not an automated trading system, and it offers no profit guarantee whatsoever. Financial markets carry the risk of total loss of the invested capital. Past performance is not indicative of future results. Every signal must be confirmed with your own analysis, a money management plan and prior testing on a demo account. The author is not responsible for trading decisions taken on the basis of this indicator.
## Suggested tags / keywords for MQL5
`multi timeframe`, `divergence`, `momentum`, `risk management`, `no repaint`, `filter`, `conflict`, `intraday`
