OPEN-SOURCE SCRIPT
350DMA bands + Z-score (V2)

This script extends the classic 350-day moving average (350DMA) by building dynamic valuation bands and a Z-Score framework to evaluate how far price deviates from its long-term mean.
Features
350DMA Anchor: Uses the 350-day simple moving average as the baseline reference.
Fixed Multipliers: Key bands plotted at ×0.625, ×1.0, ×1.6, ×2.0, and ×2.5 of the 350DMA — historically significant levels for cycle analysis.
Z-Score Mapping: Price is converted into a Z-Score on a scale from +2 (deep undervaluation) to –2 (extreme overvaluation), using log-space interpolation for accuracy.
Custom Display: HUD panel and on-chart label show the current Z-Score in real time.
Clamp Option: Users can toggle between raw Z values or capped values (±2).
How to Use
Valuation Context: The 350DMA is often considered a “fair value” anchor; large deviations identify cycles of under- or over-valuation.
Z-Score Insight:
Positive Z values suggest favorable accumulation zones where price is below long-term average.
Negative Z values highlight zones of stretched valuation, often associated with distribution or profit-taking.
Strategic Application: This is not a standalone trading system — it works best in confluence with other indicators, cycle models, or macro analysis.
Originality
Unlike a simple DMA overlay, this script:
Provides multiple cycle-based bands derived from the 350DMA.
Applies a logarithmic Z-Score mapping for more precise long-term scaling.
Adds an integrated HUD and labeling system for quick interpretation.
Features
350DMA Anchor: Uses the 350-day simple moving average as the baseline reference.
Fixed Multipliers: Key bands plotted at ×0.625, ×1.0, ×1.6, ×2.0, and ×2.5 of the 350DMA — historically significant levels for cycle analysis.
Z-Score Mapping: Price is converted into a Z-Score on a scale from +2 (deep undervaluation) to –2 (extreme overvaluation), using log-space interpolation for accuracy.
Custom Display: HUD panel and on-chart label show the current Z-Score in real time.
Clamp Option: Users can toggle between raw Z values or capped values (±2).
How to Use
Valuation Context: The 350DMA is often considered a “fair value” anchor; large deviations identify cycles of under- or over-valuation.
Z-Score Insight:
Positive Z values suggest favorable accumulation zones where price is below long-term average.
Negative Z values highlight zones of stretched valuation, often associated with distribution or profit-taking.
Strategic Application: This is not a standalone trading system — it works best in confluence with other indicators, cycle models, or macro analysis.
Originality
Unlike a simple DMA overlay, this script:
Provides multiple cycle-based bands derived from the 350DMA.
Applies a logarithmic Z-Score mapping for more precise long-term scaling.
Adds an integrated HUD and labeling system for quick interpretation.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.