Skip to content
ChartTailor
WorkServicesPricingField NotesAbout Start a build
← Field Notes

Why your RSI divergence indicator disagrees with your eyes

You can see the divergence clearly. The indicator can’t, or it flags ten you’d never have drawn. The gap between visual divergence and coded divergence is bigger than it looks.

You can see it. Price made a higher high, the RSI made a lower high, and the divergence is sitting right there as obvious as anything. So you load an automated divergence indicator to catch these for you, and it does one of two infuriating things. It misses the clean one you can see plainly. Or it litters the chart with ten divergences you’d never in your life have drawn.

Your eyes aren’t wrong. The indicator isn’t broken. They’re just doing genuinely different things, and the gap between them tells you something useful about your own pattern recognition.

What your eye actually does

When you spot a divergence, you’re not running an algorithm. You’re taking in the whole shape at once. You pick the two highs that matter, and crucially you pick them by feel, the two that look like the significant peaks. You ignore the wobble in between. You weigh how clean the move is, whether the pivots are meaningful or just noise, whether the overall context makes the divergence worth respecting. All of that happens in an instant and almost none of it is conscious.

That last part is the catch. You’re using judgement you can’t fully articulate, and a script can only do what it’s explicitly told.

What the code has to do instead

A divergence indicator can’t see the shape. It has to define a pivot mathematically. Maybe a high with two lower highs either side. Then it has to decide which pivots to compare, usually the last two that qualify. Then it checks: higher price pivot, lower oscillator pivot, flag it.

Every one of those steps is a decision your eye made by instinct, now frozen into a hard rule. And the rules are brittle. Make the pivot definition strict and it misses the clean divergence because one of your peaks didn’t have the required bars around it. Make it loose and it fires on every tiny wiggle, because now everything qualifies as a pivot and half of them happen to diverge. There’s no setting that matches your eye, because your eye isn’t using a setting. It’s using context.

Why this matters beyond divergence

This is the whole story of automating discretion, and divergence is just a clear example. Anything you spot “by feel” is running on judgement that resists being written down. When you try to code it, you discover how much of your skill was living in the gaps the rules can’t reach. That’s not a failure. It’s information about where your edge actually is.

Closing the gap

You don’t close it by hunting for the magic pivot setting. You close it by being honest about which part is mechanical and which part is judgement, and only automating the mechanical part. Let the tool find candidate divergences with loose-ish rules, and treat its output as a shortlist, not a verdict. It surfaces places to look. You still make the call on whether the shape is real, because that call was always the bit you were good at.

A divergence indicator that disagrees with your eyes isn’t failing. It’s showing you exactly how much of your read was pattern recognition that no rule fully captures. The useful version doesn’t try to replace that. It just does the tedious scanning so your judgement gets pointed at the right candles.

The useful version

Most RSI divergence disagreements are pivot disagreements. The human eye sees a turn as it forms. Code usually needs bars after the turn to confirm the pivot.

That means a divergence marker may appear late, move back to the pivot bar, or miss what your eye considers obvious because the script is using a stricter rule.

What to check

Inspect the pivot contract:

left = input.int(3)
right = input.int(3)
pivHi = ta.pivothigh(high, left, right)

With right = 3, the pivot is not known until three bars later. If the marker is drawn on the pivot candle, it can look like the script knew earlier than it did. That is not always a bug, but it must be understood.

Also check whether divergence is measured on candle highs/lows or RSI highs/lows, and whether the script requires regular divergence, hidden divergence, or both. Your eyes may be comparing a different pair of points than the code.