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.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
WaveXplorer | Elliott Wave insights
📊 X profile: @veerappa89
📊 X profile: @veerappa89
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
WaveXplorer | Elliott Wave insights
📊 X profile: @veerappa89
📊 X profile: @veerappa89
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.