INVITE-ONLY SCRIPT
Multi-Timeframe Price Zones

📌Multi-Timeframe Price Zones
This indicator plots dynamic multi-timeframe price zones—including previous highs/lows, pivot levels, and magnetic support/resistance regions—using auto-updating boxes on the chart, allowing traders to identify high-influence price areas across higher timeframes with clarity and precision.

■ Magnetic Zones 1 – Inputs
Timeframe: Selects the higher timeframe used for generating zones (e.g., D, W, M).
Show Last: Defines how many of the most recent timeframe zones to display.
PDHL: Toggles previous-day-high/low zones.
P: Toggles the pivot level (previous period midpoint).
SR1 / SR2: Enables two sets of magnetic support/resistance zones based on volatility expansion multipliers.
Sub Color: Sets the primary color used for box borders, backgrounds, and text.
■ General Zone Settings
Box Transparency: Adjusts opacity of filled price zones.
Border Style: Selects border style (solid, dashed, dotted).
Text Size: Controls label sizing for zone annotations.
Text Alignment: Positions labels inside boxes (left, center, right).

■ Data Retrieval Logic
The script pulls higher-timeframe timestamps and close times (time, time_close) using request.security, ensuring boxes start exactly at the beginning of the selected timeframe and extend to its closing bar.
A helper function retrieves any higher-timeframe price series (high, low, midpoint, and magnetic zone values).
■ Magnetic Zone Calculation
The script computes magnetic support/resistance levels using previous-bar volatility:
prev_hl_diff = previous high − previous low
Resistance = hl2 + (multiplier × prev_hl_diff)
Support = hl2 − (multiplier × prev_hl_diff)
Two multipliers are used:
0.236 → SR1
0.786 → SR2
These create responsive zones that expand/shrink with volatility.
■ Buffer Zone Expansion
Each level generates a “buffer zone”—a small band above/below the main value—to create visually meaningful zones rather than a single flat line:
top = level + range/8
bottom = level − range/8
Buffers are applied symmetrically around each SR level.

■ Zone Types Displayed
1. PDHL Zones (Previous High / Previous Low)
Retrieved directly from the selected higher timeframe’s last completed bar.
2. Pivot Zone (P)
Based on midpoint (hl2) of the previous period.
3. Magnetic Zones SR1 / SR2
Volatility-based resistance/support zones with buffer expansion.
■ Box Rendering System
The script uses a generalized draw_box() function that draws labeled rectangles using:
timeframe start/end timestamps
top/bottom price boundaries
custom background transparency
border style and width
optional price annotations
All box references are stored in arrays for proper management and future cleanup.
■ Auto-Updating Logic
Whenever the higher timeframe changes (timeframe.change()):
New boxes are created for SR1, SR2, pivot, and PDHL levels.
Boxes extend from the higher timeframe’s opening timestamp to its closing timestamp.
Price labels include the exact value and the timeframe abbreviation.
This ensures zones remain aligned with the boundaries of each higher-timeframe candle.


■ Purpose
This indicator is designed to:
Highlight multi-timeframe price zones such as PDHL, pivots, and magnetic SR ranges.
Provide contextual support/resistance from a higher timeframe while trading lower timeframes.
Visualize volatility-driven price zones that often act as reaction levels.
Draw clean, well-structured, auto-refreshing boxes with customizable styling.
It does not attempt to predict price or generate trade signals—its function is structural visualization.
■ Notes
Zones update only when the higher timeframe completes.
Buffer zones visually emphasize areas of interest rather than single price lines.
Transparency and styling allow integration into any chart layout.
This indicator plots dynamic multi-timeframe price zones—including previous highs/lows, pivot levels, and magnetic support/resistance regions—using auto-updating boxes on the chart, allowing traders to identify high-influence price areas across higher timeframes with clarity and precision.
■ Magnetic Zones 1 – Inputs
Timeframe: Selects the higher timeframe used for generating zones (e.g., D, W, M).
Show Last: Defines how many of the most recent timeframe zones to display.
PDHL: Toggles previous-day-high/low zones.
P: Toggles the pivot level (previous period midpoint).
SR1 / SR2: Enables two sets of magnetic support/resistance zones based on volatility expansion multipliers.
Sub Color: Sets the primary color used for box borders, backgrounds, and text.
■ General Zone Settings
Box Transparency: Adjusts opacity of filled price zones.
Border Style: Selects border style (solid, dashed, dotted).
Text Size: Controls label sizing for zone annotations.
Text Alignment: Positions labels inside boxes (left, center, right).
■ Data Retrieval Logic
The script pulls higher-timeframe timestamps and close times (time, time_close) using request.security, ensuring boxes start exactly at the beginning of the selected timeframe and extend to its closing bar.
A helper function retrieves any higher-timeframe price series (high, low, midpoint, and magnetic zone values).
■ Magnetic Zone Calculation
The script computes magnetic support/resistance levels using previous-bar volatility:
prev_hl_diff = previous high − previous low
Resistance = hl2 + (multiplier × prev_hl_diff)
Support = hl2 − (multiplier × prev_hl_diff)
Two multipliers are used:
0.236 → SR1
0.786 → SR2
These create responsive zones that expand/shrink with volatility.
■ Buffer Zone Expansion
Each level generates a “buffer zone”—a small band above/below the main value—to create visually meaningful zones rather than a single flat line:
top = level + range/8
bottom = level − range/8
Buffers are applied symmetrically around each SR level.
■ Zone Types Displayed
1. PDHL Zones (Previous High / Previous Low)
Retrieved directly from the selected higher timeframe’s last completed bar.
2. Pivot Zone (P)
Based on midpoint (hl2) of the previous period.
3. Magnetic Zones SR1 / SR2
Volatility-based resistance/support zones with buffer expansion.
■ Box Rendering System
The script uses a generalized draw_box() function that draws labeled rectangles using:
timeframe start/end timestamps
top/bottom price boundaries
custom background transparency
border style and width
optional price annotations
All box references are stored in arrays for proper management and future cleanup.
■ Auto-Updating Logic
Whenever the higher timeframe changes (timeframe.change()):
New boxes are created for SR1, SR2, pivot, and PDHL levels.
Boxes extend from the higher timeframe’s opening timestamp to its closing timestamp.
Price labels include the exact value and the timeframe abbreviation.
This ensures zones remain aligned with the boundaries of each higher-timeframe candle.
■ Purpose
This indicator is designed to:
Highlight multi-timeframe price zones such as PDHL, pivots, and magnetic SR ranges.
Provide contextual support/resistance from a higher timeframe while trading lower timeframes.
Visualize volatility-driven price zones that often act as reaction levels.
Draw clean, well-structured, auto-refreshing boxes with customizable styling.
It does not attempt to predict price or generate trade signals—its function is structural visualization.
■ Notes
Zones update only when the higher timeframe completes.
Buffer zones visually emphasize areas of interest rather than single price lines.
Transparency and styling allow integration into any chart layout.
仅限邀请脚本
只有作者授权的用户才能访问此脚本。您需要申请并获得使用许可。通常情况下,付款后即可获得许可。更多详情,请按照下方作者的说明操作,或直接联系c9indicator。
TradingView不建议您付费购买或使用任何脚本,除非您完全信任其作者并了解其工作原理。您也可以在我们的社区脚本找到免费的开源替代方案。
作者的说明
This script is provided as Invite-Only. If you would like to request access, please send me a message on my TradingView profile including your username.
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
仅限邀请脚本
只有作者授权的用户才能访问此脚本。您需要申请并获得使用许可。通常情况下,付款后即可获得许可。更多详情,请按照下方作者的说明操作,或直接联系c9indicator。
TradingView不建议您付费购买或使用任何脚本,除非您完全信任其作者并了解其工作原理。您也可以在我们的社区脚本找到免费的开源替代方案。
作者的说明
This script is provided as Invite-Only. If you would like to request access, please send me a message on my TradingView profile including your username.
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。