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.
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
WaveXplorer | Elliott Wave insights
📊 X profile: @veerappa89
📊 X profile: @veerappa89
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
WaveXplorer | Elliott Wave insights
📊 X profile: @veerappa89
📊 X profile: @veerappa89
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。