INVITE-ONLY SCRIPT

Gann Square Levels 1 to infinity by Nishant

93
Gann Square Levels 1 to infinity by Nishant

This indicator plots dynamic horizontal price levels based on the squares of whole numbers (1², 2², 3², …) with a small adjustment rule: if a square ends with an even digit, 1 is added to make it odd (for example, 4² = 16 → 17). The script displays a configurable number of the nearest levels above and below the current price and updates automatically as price moves.

Key features • Dynamic: shows N levels above and below the current price (default 5 each) and updates live.
• Adjustment rule: every square that ends with an even digit is incremented by 1 to make it odd.
• Highly configurable: customize number of levels, colors, line width, line style, and line extension (None / Left / Right / Both).
• Labels: optional labels show level values.
• Efficient: searches near sqrt(price) to keep calculations fast and avoid TradingView object limits.
• Safe object handling: the script deletes and recreates lines/labels safely to avoid runtime errors.

Inputs / user controls • Number of Levels Above/Below — how many levels are shown on each side of price.
• Above Price Line Color / Below Price Line Color — choose distinct colors for clarity.
• Line Width — thickness of plotted lines.
• Line Style — Solid, Dashed, Dotted, Arrow Left/Right/Both.
• Line Extension — None, Left, Right, Both (choose how lines extend across the chart).
• Auto Update — toggle live updates on/off.
• Show Level Labels — toggle numeric labels.

Recommended usage • Best used as a reference grid for support/resistance planning, confluence studies, and alert generation.
• Works on any timeframe and instrument, but consider increasing Number of Levels for instruments with very high price scales (or leave default and let the script pick nearest levels).
• Combine with volume, momentum, or price-action signals for higher-probability setups.

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.