HorizonAI
IndicatorFree

Market Structure RSI

The Market Structure RSI is an innovative indicator that combines traditional RSI analysis with market structure principles to provide more accurate overbought/oversold signals. Filters out false signals by requiring structure confirmation. A powerful base script to extend with HorizonAI.

Full Source Code
Alert Templates
Build on with HorizonAI

What's Included

Structure + RSI confluence
Divergence confirmation
Filtered BOS signals
RSI overbought/oversold context
Higher probability setups
Alert on confirmed breaks

How Market Structure RSI works

The Relative Strength Index measures the speed and magnitude of recent price changes on a bounded scale, and traders use it to flag overbought or oversold conditions and to spot divergence, where price makes a new extreme but RSI does not. The weakness of RSI used alone is that overbought can stay overbought in a strong trend, so raw signals produce a lot of false alarms.

This concept pairs RSI with market-structure confirmation to filter those false signals. Instead of acting on an oversold reading in isolation, you wait for the price structure to agree, for example a shift in structure or a respected swing that supports the RSI condition, so momentum and structure are telling the same story before a setup qualifies.

The combination is about quality over quantity. Structure provides the directional framework and the location, while RSI adds a momentum and divergence lens; when both align the setup carries more weight, and when they conflict the signal is discarded, which cuts down on the whipsaw that plagues momentum oscillators in isolation.

When to use it

  • Filtering out weak RSI signals by requiring supportive market structure before acting.
  • Hunting for momentum divergence at structural swing points where a reversal is more plausible.
  • Timing pullback entries in a trend when RSI resets and structure remains intact.
  • Avoiding counter-trend traps by only trading oversold or overbought readings that structure confirms.

When it's not the right tool

  • In powerful trends where RSI stays pinned at an extreme for long stretches and 'overbought' keeps rising.
  • When structure is unclear or conflicting, which removes the confirmation the method depends on.
  • As a mechanical buy-oversold, sell-overbought system, which tends to fight strong directional moves.

Source Code Preview

Get the full PineScript v6 source code—use it as a foundation and build on top of it with HorizonAI.

market-structure-rsi.pine
1//@version=6
2indicator("Market Structure RSI", overlay=true)
3// ─────────────────────────────────────
4// Market Structure RSI - Full Source Code
5// ─────────────────────────────────────
6
7// Input Settings
8pivotLen = input.int(5, "Pivot Length")
9showLabels = input.bool(true, "Show Labels")
10
11// Core Logic
12pivotHigh = ta.pivothigh(high, pivotLen, pivotLen)
13pivotLow = ta.pivotlow(low, pivotLen, pivotLen)
14
15// Structure Detection
16var float lastHigh = na
17var float lastLow = na
18
19if not na(pivotHigh)
20 lastHigh := pivotHigh
21 // ... more logic
22
23// Break of Structure
24bosUp = close > lastHigh

200+ lines of source code

Sign up for free to access the full source code

Get Free Access

Frequently asked questions

Why combine RSI with market structure at all?

RSI on its own generates frequent false signals because overbought and oversold conditions can persist in a trend. Requiring structural confirmation means momentum and price context have to agree, which filters out many of the low-quality signals and improves setup selection.

What is RSI divergence and why does it matter here?

Divergence is when price makes a higher high or lower low but RSI fails to follow, hinting that momentum is fading. Anchored to a structural swing point, divergence becomes a more meaningful early-warning cue than divergence spotted in isolation.

Does structure confirmation make RSI signals reliable?

It improves quality but nothing makes signals reliable in an absolute sense. Combining the two reduces noise, yet false signals still occur, so position sizing, invalidation levels and your own judgement remain essential. None of this is financial advice.

Get access to all 23+ scripts

Full source code, alert templates, and the perfect base to build on with HorizonAI. Join 10,000+ traders.