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.
Script su invito
Solo gli utenti approvati dall'autore possono accedere a questo script. È necessario richiedere e ottenere l'autorizzazione per utilizzarlo. Tale autorizzazione viene solitamente concessa dopo il pagamento. Per ulteriori dettagli, seguire le istruzioni dell'autore riportate di seguito o contattare direttamente nishantsingh040694.
TradingView NON consiglia di pagare o utilizzare uno script a meno che non ci si fidi pienamente del suo autore e non si comprenda il suo funzionamento. Puoi anche trovare alternative gratuite e open-source nei nostri script della comunità.
Istruzioni dell'autore
Declinazione di responsabilità
Script su invito
Solo gli utenti approvati dall'autore possono accedere a questo script. È necessario richiedere e ottenere l'autorizzazione per utilizzarlo. Tale autorizzazione viene solitamente concessa dopo il pagamento. Per ulteriori dettagli, seguire le istruzioni dell'autore riportate di seguito o contattare direttamente nishantsingh040694.
TradingView NON consiglia di pagare o utilizzare uno script a meno che non ci si fidi pienamente del suo autore e non si comprenda il suo funzionamento. Puoi anche trovare alternative gratuite e open-source nei nostri script della comunità.