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提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。