OPEN-SOURCE SCRIPT
Gann Grid Master smaller- Max Range Auto

Gann Grid Master is a Pine Script v6 indicator that automatically draws a sophisticated Gann-style horizontal grid on the chart.
It starts from a user-defined Base Price (anchor) and Base Range (main unit), then creates layered subdivisions by repeatedly halving the interval (1/2, 1/4, 1/8, 1/16, etc.) up to a chosen max depth.
Key Smart Features:
Automatic range calculation — It intelligently determines the maximum number of steps it can draw without exceeding TradingView’s 500-line limit.
Dynamic line styling (different width + solid/dashed/dotted) based on importance/depth.
Only draws lines near current price (performance optimized).
Thick base anchor line.
Info label showing current max range and lines used.
The result is a clean, dense grid of horizontal support/resistance levels based on geometric proportions (Gann’s mathematical approach).
Main Use Cases:
Gann Theory Traders: Core tool for those who use Gann Squares, geometric angles, and cardinal levels. The grid helps identify high-probability reversal or breakout zones.
Support/Resistance Trading: Excellent for spotting confluence zones — areas where multiple grid lines cluster often act as strong magnets or barriers.
Scalping & Intraday: On lower timeframes (1m–15m), the finer subdivisions (depth 3–5) give precise micro-levels.
Swing/Position Trading: On higher timeframes, it reveals major structural levels derived from important anchors (e.g., round numbers, all-time highs, earnings gaps, etc.).
Range-Bound Markets: Very effective in sideways or contracting volatility environments where price respects mathematical divisions.
Psychological Level Trading: Set the Base Price to a major round number (e.g., 100.00, 4500, etc.) and let the grid expand outward automatically.
Pro Tip: Combine it with volume profile, order blocks, or Fibonacci for even stronger confluences. Many Gann traders also use the base price/range from significant swing highs/lows.This version is particularly clean and practical because it solves the common problem of hitting TradingView’s line limit by automatically optimizing the visible range.
It starts from a user-defined Base Price (anchor) and Base Range (main unit), then creates layered subdivisions by repeatedly halving the interval (1/2, 1/4, 1/8, 1/16, etc.) up to a chosen max depth.
Key Smart Features:
Automatic range calculation — It intelligently determines the maximum number of steps it can draw without exceeding TradingView’s 500-line limit.
Dynamic line styling (different width + solid/dashed/dotted) based on importance/depth.
Only draws lines near current price (performance optimized).
Thick base anchor line.
Info label showing current max range and lines used.
The result is a clean, dense grid of horizontal support/resistance levels based on geometric proportions (Gann’s mathematical approach).
Main Use Cases:
Gann Theory Traders: Core tool for those who use Gann Squares, geometric angles, and cardinal levels. The grid helps identify high-probability reversal or breakout zones.
Support/Resistance Trading: Excellent for spotting confluence zones — areas where multiple grid lines cluster often act as strong magnets or barriers.
Scalping & Intraday: On lower timeframes (1m–15m), the finer subdivisions (depth 3–5) give precise micro-levels.
Swing/Position Trading: On higher timeframes, it reveals major structural levels derived from important anchors (e.g., round numbers, all-time highs, earnings gaps, etc.).
Range-Bound Markets: Very effective in sideways or contracting volatility environments where price respects mathematical divisions.
Psychological Level Trading: Set the Base Price to a major round number (e.g., 100.00, 4500, etc.) and let the grid expand outward automatically.
Pro Tip: Combine it with volume profile, order blocks, or Fibonacci for even stronger confluences. Many Gann traders also use the base price/range from significant swing highs/lows.This version is particularly clean and practical because it solves the common problem of hitting TradingView’s line limit by automatically optimizing the visible range.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.