OPEN-SOURCE SCRIPT
Relative Strength vs Benchmark [Mansfield RS]

What this does
This indicator measures whether a stock is outperforming or underperforming a chosen benchmark index, using the Mansfield Relative Strength method — a technique long used by momentum/trend traders but rarely available as a simple, ready-to-use tool.
Why not just plot a price ratio?
A raw stock-price-to-index-price ratio only tells you if the ratio is rising or falling — the actual number means nothing on its own, and it's easy to misread. Mansfield RS fixes this by measuring how far that ratio has moved away from its own recent average, giving you a clean oscillator that centers on a zero line:
Settings
How to use it
Best used as context alongside your own price-action or trend analysis — not as a standalone buy/sell trigger. A bullish setup that's also showing strong relative strength is a meaningfully different situation than the same setup on a stock quietly underperforming the market. Works especially well for filtering which names in a watchlist deserve attention first.
Alerts
Built-in alerts fire when relative strength turns positive or negative (zero-line cross).
Disclaimer
This is a context/screening tool, not a standalone trading signal. Not financial advice — always confirm with your own analysis and risk management.
This indicator measures whether a stock is outperforming or underperforming a chosen benchmark index, using the Mansfield Relative Strength method — a technique long used by momentum/trend traders but rarely available as a simple, ready-to-use tool.
Why not just plot a price ratio?
A raw stock-price-to-index-price ratio only tells you if the ratio is rising or falling — the actual number means nothing on its own, and it's easy to misread. Mansfield RS fixes this by measuring how far that ratio has moved away from its own recent average, giving you a clean oscillator that centers on a zero line:
- Above zero (green) — the stock is outperforming its own recent relative trend against the benchmark.
- Below zero (red) — it's underperforming.
- The zero-line cross is the actual signal — marked with triangles — not the absolute level.
Settings
- Benchmark / Index — pick any index or stock to compare against (defaults to NSE:NIFTY, but works with any sector index or benchmark you want).
- Smoothing MA Length (default 200) — controls how far back the "recent average" baseline looks. Shorter = faster, noisier signals. Longer = slower, more meaningful regime changes.
How to use it
Best used as context alongside your own price-action or trend analysis — not as a standalone buy/sell trigger. A bullish setup that's also showing strong relative strength is a meaningfully different situation than the same setup on a stock quietly underperforming the market. Works especially well for filtering which names in a watchlist deserve attention first.
Alerts
Built-in alerts fire when relative strength turns positive or negative (zero-line cross).
Disclaimer
This is a context/screening tool, not a standalone trading signal. Not financial advice — always confirm with your own analysis and risk management.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
WaveXplorer | Elliott Wave insights
📊 X profile: @veerappa89
📊 X profile: @veerappa89
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
WaveXplorer | Elliott Wave insights
📊 X profile: @veerappa89
📊 X profile: @veerappa89
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.