OPEN-SOURCE SCRIPT

OA - Price Magnet Zones

2 095
snapshotPrice Magnet Zones Indicator

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:
  1. Bullish Levels: Candles with no bottom wick (open = low) that close higher
  2. 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.

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.