OPEN-SOURCE SCRIPT
OA - Price Magnet Zones

Overview
The Price Magnet Zones indicator identifies special price levels that have a high statistical probability of being revisited by price in the future.
It works by detecting candles with specific formation characteristics - those without top or bottom wicks - which often signify important market levels that price tends to return to.
Key Features
Automated Detection: Identifies special candle formations automatically and draws horizontal lines at these levels
Dynamic Management Removes lines once price touches them or when they exceed the lookback period
Statistical Analysis: Tracks touch rates and average time until price returns to these levels
Clean Visual Interface: Shows only untouched levels for a clear chart view
How It Works
The indicator detects two specific types of candle formations:
- Bullish Levels: Candles with no bottom wick (open = low) that close higher
- Bearish Levels: Candles with no top wick (open = high) that close lowe
These formations often represent hidden liquidity zones or order blocks where price tends to return. The indicator draws horizontal lines at these levels and tracks whether price revisits them.
Statistics Tracking
- The indicator maintains comprehensive statistics about the detected levels:
- Total Levels: Number of bullish, bearish, and total levels detected
- Touched Levels: Number of levels that price has returned to touch
- Touch Rate: Percentage of levels that have been touched by price
- Average Touch Time: Average number of bars until price touches each level type
Trading Applications
These hidden levels can be valuable for:
- Identifying potential support and resistance zones
- Finding entry and exit points for trades
- Setting stop loss levels
- Determining price targets
- Confirming other technical signals
Settings
- Max Bars to Track: Maximum number of bars to keep tracking a level (default: 500)
- Line Thickness: Visual thickness of the horizontal lines (1-4)
- Line Color: Color of the horizontal lines
- Min Candles Before Check: Number of candles to wait before including touches in statistics (default: 3)
- Show Statistics: Toggle statistics table display
Usage Tips
- The statistics only count touches that occur after the specified minimum number of candles have passed, providing more meaningful data
- Higher touch rates indicate stronger magnetic properties of these levels
- The average touch time can help with timing expectations for trades
- These levels work across various timeframes and markets
- For best results, use alongside other technical analysis tools
This indicator does not provide trading signals but offers valuable insights into hidden market structure that can enhance your trading strategy.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.