PROTECTED SOURCE SCRIPT
Seasonality Advanced

Description This is a professional-grade Seasonality Analysis tool designed to project future price trends based on historical cyclical patterns. Unlike simple seasonal indicators that just average price, this script offers a statistical approach with a "Zero Gravity" visualization mode and a real-time Data Dashboard.
Underlying Concepts & Methodology The script calculates the seasonal tendency by averaging the price performance of the same day/week over a user-defined lookback period (e.g., 5, 10, or 15 years).
Data Alignment: It aligns historical data based on trading days (default 252) or calendar days to create a coherent "Annual Cycle".
Smoothing: A Moving Average is applied to the raw seasonal data to filter out noise and reveal the true macro tendency.
Correlation Engine: It calculates the real-time correlation between the current price action and the projected seasonal line. This acts as a "Lie Detector"—if correlation is high, the seasonal pattern is currently valid.
Key Features
Multi-Cycle Analysis: Plot up to 3 different seasonal baselines simultaneously (e.g., Short-term 5Y vs. Long-term 15Y cycles).
Zero Gravity View: Uses a "Joyplot" style separation (Stacking) to prevent lines from overlapping messily, making it easier to compare different cycles.
Statistical Dashboard: A built-in table displays Avg Return, WinRate, Volatility Risk, and Correlation.
How to Use
Projections: Use the lines extending into the future to anticipate potential turning points.
Confluence: When the 5-year and 10-year lines point in the same direction, the probability increases.
Filter: Watch the "Correlation" column in the table. Low correlation means the current market is decoupling from history.
[English Translation of User Interface]
To comply with House Rules regarding non-English UI, here is the translation of the script's settings menu:
1. Cálculos Sazo 3 (Calculation Settings)
Dias de negociação = Trading Days (Fixed 252 or Variable)
Método de dias = Day Count Method (Min, Max, Avg)
Projeção Futura (Barras) = Future Projection (Bars)
Suavização (Média) = Smoothing (MA Length)
Deslocamento = Offset
2. Visualização e Layout (Visuals)
Empilhamento / Separação (%) = Stacking / Separation %
Distância Vertical = Vertical Distance
Distância da Etiqueta = Label Offset
3. Painel Estatístico (Statistics Panel)
Mostrar Tabela = Show Table
Mostrar Próximo Mês = Show Next Month
Mostrar Linha Méd/Alvo = Show Avg/Target Row
Texto Suave = Soft Text (Transparency)
Período Correlação = Correlation Period
Tema = Theme (Dark/Light)
Tamanho = Size
Posição = Position
4. Linha de Hoje (Today's Line)
Mostrar Linha = Show Vertical Line
Cor/Estilo/Espessura = Color/Style/Width
5. Linhas 1, 2, 3 (Seasonal Lines)
Ativar Linha = Enable Line
Período (anos) = Lookback Period (Years)
Descrição Este indicador é uma ferramenta completa de Sazonalidade que projeta tendências futuras baseadas em padrões históricos. Ele inclui um painel estatístico exclusivo que mostra a probabilidade (WinRate) e a correlação do ciclo atual.
Funcionalidades
Projeção Futura: Desenha o comportamento provável do preço para os próximos dias.
Painel Estatístico: Mostra retorno médio, risco e correlação em tempo real.
Zero Gravity: Visualização empilhada para facilitar a leitura de múltiplos ciclos.
Underlying Concepts & Methodology The script calculates the seasonal tendency by averaging the price performance of the same day/week over a user-defined lookback period (e.g., 5, 10, or 15 years).
Data Alignment: It aligns historical data based on trading days (default 252) or calendar days to create a coherent "Annual Cycle".
Smoothing: A Moving Average is applied to the raw seasonal data to filter out noise and reveal the true macro tendency.
Correlation Engine: It calculates the real-time correlation between the current price action and the projected seasonal line. This acts as a "Lie Detector"—if correlation is high, the seasonal pattern is currently valid.
Key Features
Multi-Cycle Analysis: Plot up to 3 different seasonal baselines simultaneously (e.g., Short-term 5Y vs. Long-term 15Y cycles).
Zero Gravity View: Uses a "Joyplot" style separation (Stacking) to prevent lines from overlapping messily, making it easier to compare different cycles.
Statistical Dashboard: A built-in table displays Avg Return, WinRate, Volatility Risk, and Correlation.
How to Use
Projections: Use the lines extending into the future to anticipate potential turning points.
Confluence: When the 5-year and 10-year lines point in the same direction, the probability increases.
Filter: Watch the "Correlation" column in the table. Low correlation means the current market is decoupling from history.
[English Translation of User Interface]
To comply with House Rules regarding non-English UI, here is the translation of the script's settings menu:
1. Cálculos Sazo 3 (Calculation Settings)
Dias de negociação = Trading Days (Fixed 252 or Variable)
Método de dias = Day Count Method (Min, Max, Avg)
Projeção Futura (Barras) = Future Projection (Bars)
Suavização (Média) = Smoothing (MA Length)
Deslocamento = Offset
2. Visualização e Layout (Visuals)
Empilhamento / Separação (%) = Stacking / Separation %
Distância Vertical = Vertical Distance
Distância da Etiqueta = Label Offset
3. Painel Estatístico (Statistics Panel)
Mostrar Tabela = Show Table
Mostrar Próximo Mês = Show Next Month
Mostrar Linha Méd/Alvo = Show Avg/Target Row
Texto Suave = Soft Text (Transparency)
Período Correlação = Correlation Period
Tema = Theme (Dark/Light)
Tamanho = Size
Posição = Position
4. Linha de Hoje (Today's Line)
Mostrar Linha = Show Vertical Line
Cor/Estilo/Espessura = Color/Style/Width
5. Linhas 1, 2, 3 (Seasonal Lines)
Ativar Linha = Enable Line
Período (anos) = Lookback Period (Years)
Descrição Este indicador é uma ferramenta completa de Sazonalidade que projeta tendências futuras baseadas em padrões históricos. Ele inclui um painel estatístico exclusivo que mostra a probabilidade (WinRate) e a correlação do ciclo atual.
Funcionalidades
Projeção Futura: Desenha o comportamento provável do preço para os próximos dias.
Painel Estatístico: Mostra retorno médio, risco e correlação em tempo real.
Zero Gravity: Visualização empilhada para facilitar a leitura de múltiplos ciclos.
Skrypt chroniony
Ten skrypt został opublikowany jako zamknięty kod źródłowy. Można z tego korzystać swobodnie i bez żadnych ograniczeń — więcej informacji znajduje się tutaj.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt chroniony
Ten skrypt został opublikowany jako zamknięty kod źródłowy. Można z tego korzystać swobodnie i bez żadnych ograniczeń — więcej informacji znajduje się tutaj.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.