In this article
After this article, you can
- Check how the ROC period changes the same pivot comparison.
- Record indicator parameters and recognition time.
Terms at hand: Divergence · Backtesting · Trading Journal · Trading Plan · Relative Strength Index (RSI) · MACD (Moving Average Convergence Divergence)
Divergence compares selected price extremes with indicator readings. For a hypothetical pair of lows, price can fall from 100 to 99 while a momentum reading rises. That describes a disagreement under the chosen formula and point-selection rule; it does not certify weaker selling pressure or a future reversal. The worked example below shows the complete prices and when the comparison becomes available.
What divergence actually is
Divergence is a comparison between price and an oscillator such as RSI or MACD. Specify which two price points and indicator observations are paired. Indicator formulas transform their stated inputs; they do not directly measure the cost of a move or participants’ buying and selling intentions. Changing parameters or selecting different points can change the classification.
A divergence label does not by itself define an entry, exit, position size or available fill price. A strategy may use it as a condition, but its future outcome needs separate testing with costs. An additional candle pattern or level break is another condition, not a guarantee that reversal has begun. Do not choose only the historical disagreements followed by an attractive move.
Divergence also depends on the indicator period
Keep the pivot rule and the same reading candles. Change only the ROC period to see why an oscillator name without parameters is insufficient.
Scroll sideways to see the full diagram
Hypothetical model: Candle closes 0–15:121, 120, 119, 118, 110, 105, 100, 104, 130, 120, 110, 105, 103, 99, 101, 102. Both lows are below two neighbours on either side; the second is recognized only after candle 15. Read the oscillator exactly at the pivots. ROC formula: Fidelity. The diagram does not forecast the next price.
Four types of divergence — regular and hidden
The regular/hidden names classify relations between two selected points. Whether those points turn out to be the end of a trend is future information, not part of a signal that was available at the time. Define the preceding trend separately if a rule uses that context. Terminology also varies: RSI discussions may call the opposite geometry positive or negative reversals.
A complete ROC example and recognition time
Use these hypothetical closed-bar prices in abstract price units. ROC(2) = 100 × (C[t]/C[t−2] − 1). Our own low rule requires a close strictly below the two closes on either side; equal values fail. Compare successive price lows and read ROC at those exact bars, rather than find separate oscillator lows. This is one possible detector, not a platform-wide standard.
| Bar | Close | ROC(2) |
|---|---|---|
| 0 | 110 | Unavailable |
| 1 | 109 | Unavailable |
| 2 | 100 | −9.09% |
| 3 | 104 | −4.59% |
| 4 | 106 | 6.00% |
| 5 | 105 | 0.96% |
| 6 | 102 | −3.77% |
| 7 | 99 | −5.71% |
| 8 | 101 | −0.98% |
| 9 | 103 | 4.04% |
| 10 | 98 | −2.97% |
The first recognized low is bar 2, confirmed after bar 4. Bar 7 is lower, but only qualifies after bar 9 closes. Its ROC(2) is higher: −5.7143% versus −9.0909%, a difference of about 3.3766 percentage points. Both readings remain negative. Bar 10 then closes at 98: correct bullish geometry did not require the next price to rise.
After bar 9 closes, the comparison is known; that close is 103, not the earlier low of 99. Booking an entry at bar 7 using its later confirmation inserts unavailable information. A separately specified reversal candlestick pattern or level break could be an additional test condition, but does not identify who traded or ensure profit. Record the actual decision time and subsequent fill assumptions.
When the disagreement means continuation rather than reversal
For hidden bullish geometry, selected price lows rise while selected oscillator lows fall. In an upward context this is often studied as a continuation hypothesis; the bearish counterpart pairs lower price highs with higher oscillator highs. Neither relation proves that demand or supply is stronger, nor that this variant is more convenient or profitable. Keep the context and point-selection rules explicit.
A low recognized later cannot automatically serve as a contemporaneous entry. If a test adds a stop or target, specify when each becomes known, its order type, size, costs and how unavailable or unfilled orders are handled. There is no universal twelve-pip invalidation distance. Ordinary stop execution may differ from the planned level, so the planned distance is not a maximum possible loss.
How to build a trade around divergence
- Freeze inputs. Record instrument, feed, timeframe, price source, oscillator formula and period.
- Define extrema. State left/right neighbours, tie handling and the latest bar needed for recognition.
- Freeze pairing. Exact price-pivot bars and independent oscillator pivots are different methods.
- Classify geometry. Separate the regular/hidden label from a measured future outcome.
- Define context and extra conditions. A trend rule or candle condition must be known at the decision time.
- Define execution. State entry, exit, size, costs and fill assumptions, including failed or unfilled orders.
- Evaluate all qualifying cases. Separate development from unused data and retain unfavorable outcomes.
Parameters to record and test
Errors that can change the comparison
- Using later confirmation earlier. Record recognition time separately from the bar where a marker is drawn.
- Changing the point rule. Exact-bar values and nearby oscillator minima can give opposite labels.
- Changing parameters after the result. Retain every tested variant and evaluate a fixed version on unused data.
- Treating missing values as zero. A ROC reading needs its reference close and a nonzero denominator; missing input is not a neutral reading.
- Selecting only reversals. Keep all qualifying comparisons, including those followed by continuation, and define the evaluation horizon.
What to do tomorrow
- Recalculate the supplied series. Check all ROC(2) values, the two lows and their recognition bars. No trading account is needed.
- Change one rule. Try requiring three right-hand closes instead of two and record which data must be available. A pivot at bar 20 would require closure of bar 23, not an entry booked at bar 20.
- Design a separate evaluation. Freeze feed, timeframe, pairing, indicator settings and future horizon. Include every case, costs and fill assumptions if testing trades; keep later unused data for evaluation.
Related material: if you want to go deeper into the indicators themselves — the parameters, the traps in the readings and the differences between the two oscillators as divergence detectors — we cover that separately in the piece on divergence on RSI and MACD.
Check your understanding
One short exercise
About 2 min · you can try again
ROC(2) rises between the same price lows while ROC(5) falls. What explains this difference?
- The second pivot moved to another candle.
- The comparison period for the earlier price changed.
- One variant proves the next candle will rise.
Check the answer and explanation
The comparison period for the earlier price changed.
ROC(2) uses C4 and C11; ROC(5) uses C1 and C8. These different bases change the relation between readings.
Frequently asked
What exactly is divergence?
It is a disagreement under a defined point comparison. In the lesson’s hypothetical series, price lows fall from 100 to 99 while ROC(2) rises from −9.0909% to −5.7143%. That is regular bullish geometry, although both readings remain negative. It does not prove diminished selling pressure or a reversal: the next close is 98. Specify inputs, point pairing and recognition time before interpreting the label.
How does regular divergence differ from hidden divergence?
Regular bullish geometry pairs a lower price low with a higher oscillator low; regular bearish pairs a higher price high with a lower oscillator high. Hidden bullish pairs a higher price low with a lower oscillator low, and hidden bearish a lower price high with a higher oscillator high. Reversal and continuation are hypotheses studied in a defined context, not future facts built into those names. Terminology can vary between authors.
How can indicator settings change divergence?
There is no universally best indicator or period. Different formulas and selected components can classify the same price points differently. The diagram holds price lows fixed while changing ROC(2) to ROC(5), which removes regular bullish geometry. Record parameters and pairings, then evaluate a fixed rule on unused data. Choosing whichever tool shows the desired historical label is a different selection process and must be disclosed.
How should an additional divergence condition be evaluated?
Define the outcome and horizon, then measure all cases under fixed rules. A price condition or support level may be tested as a filter, but it does not guarantee reliability; neither does H4 or another timeframe. Check availability first: our two-right-bar pivot at bar 7 is only recognized after bar 9 closes. Comparing a filter’s retained winners alone omits rejected and losing cases and cannot establish an improvement.
Sources & bibliography
-
Investopedia Divergence Definition · An explanatory definition of divergence. www.investopedia.com ↗
-
BabyPips Divergence Cheat Sheet · An educational reference on divergence. www.babypips.com ↗
-
Constance Brown Technical Analysis for the Trading Professional · A book reference on divergence and technical analysis. www.amazon.com ↗
-
Fidelity Rate of Change (ROC) · Defines the percentage change from a closing price n periods earlier. The lesson’s complete price sequences use this formula as hypothetical arithmetic, without a performance claim. www.fidelity.com ↗
-
TradingView Relative Strength Index (RSI) · Documents regular divergence and the opposite price/RSI geometry discussed under Cardwell reversals. Interpretations and names are distinguished from guaranteed future outcomes. www.tradingview.com ↗
-
TradingView Repainting — Pine Script documentation · Explains how a pivot marker can be drawn on an earlier bar only after later bars confirm it. Used to distinguish a pivot’s price from information available at decision time. www.tradingview.com ↗
