OPEN-SOURCE SCRIPT
FeraTrading Rolling Price Magnet

FeraTrading Rolling Price Magnet
This indicator highlights the price zones where the market has spent the most time over a recent window of bars. Instead of using moving averages or fixed levels, it scans past price action and identifies the levels that price has interacted with most frequently, helping reveal natural areas of interest, support, or resistance.
Overview
The script looks back a user-defined number of bars and breaks the price range into small zones (bins). It then counts how often price traveled through each zone and ranks them by frequency. The most-visited levels are plotted directly on the chart as horizontal lines.
This creates a dynamic view of where the market has been spending time, rather than relying on static indicators or lagging averages.
How It Works
The indicator looks back over the last X bars.
Each candle contributes price “hits” based on the selected mode:
Full Range: Counts all price levels between the candle’s low and high.
Positive Close: Only counts upward movement for candles that closed higher than the previous close.
Negative Close: Only counts downward movement for candles that closed lower than the previous close.
Price is grouped into small zones using a configurable bin size.
The script counts how often price passes through each zone.
The top most-visited levels are plotted as horizontal lines.
Visual Behavior
Green line: Most-visited price level.
Yellow line: Second most-visited level.
Orange line: Third most-visited level.
Optional labels display how many times each level was hit.
Lines update continuously as the rolling lookback window moves forward.
Inputs
Lookback Bars: Number of past bars used to calculate levels.
Top Levels: How many price levels to display.
Hit Mode:
Full Range
Positive Close
Negative Close
Bin Size: Controls the width of each price zone (in ticks or points).
Spacing Filter: Option to only count bars that are a minimum number of bars apart.
Line Width / Label Toggle: Visual customization options.
Use Case Summary
This indicator is useful for:
Finding natural support and resistance zones.
Identifying price “acceptance” areas.
Spotting magnets where price tends to return.
It works well across intraday and swing timeframes, especially on liquid instruments where price interacts frequently with key levels.
This indicator highlights the price zones where the market has spent the most time over a recent window of bars. Instead of using moving averages or fixed levels, it scans past price action and identifies the levels that price has interacted with most frequently, helping reveal natural areas of interest, support, or resistance.
Overview
The script looks back a user-defined number of bars and breaks the price range into small zones (bins). It then counts how often price traveled through each zone and ranks them by frequency. The most-visited levels are plotted directly on the chart as horizontal lines.
This creates a dynamic view of where the market has been spending time, rather than relying on static indicators or lagging averages.
How It Works
The indicator looks back over the last X bars.
Each candle contributes price “hits” based on the selected mode:
Full Range: Counts all price levels between the candle’s low and high.
Positive Close: Only counts upward movement for candles that closed higher than the previous close.
Negative Close: Only counts downward movement for candles that closed lower than the previous close.
Price is grouped into small zones using a configurable bin size.
The script counts how often price passes through each zone.
The top most-visited levels are plotted as horizontal lines.
Visual Behavior
Green line: Most-visited price level.
Yellow line: Second most-visited level.
Orange line: Third most-visited level.
Optional labels display how many times each level was hit.
Lines update continuously as the rolling lookback window moves forward.
Inputs
Lookback Bars: Number of past bars used to calculate levels.
Top Levels: How many price levels to display.
Hit Mode:
Full Range
Positive Close
Negative Close
Bin Size: Controls the width of each price zone (in ticks or points).
Spacing Filter: Option to only count bars that are a minimum number of bars apart.
Line Width / Label Toggle: Visual customization options.
Use Case Summary
This indicator is useful for:
Finding natural support and resistance zones.
Identifying price “acceptance” areas.
Spotting magnets where price tends to return.
It works well across intraday and swing timeframes, especially on liquid instruments where price interacts frequently with key levels.
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
Enjoy :)
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
Enjoy :)
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。