PROTECTED SOURCE SCRIPT
Seasonality

Seasonality Analysis
This script is a technical tool designed to identify and project historical price cycles onto the current chart. It calculates the average price movement for specific time intervals (days, weeks, or months) over a multi-year lookback period to highlight recurring seasonal patterns.
Technical Features
Historical Averaging: Aggregates price deltas ($Close - Close[1]$) for each calendar "slot" (e.g., Trading Day 1–252) over a user-defined period (up to 30 years).
Multi-Timeframe Support: Automatically adapts to Daily (252 days), Weekly (52 weeks), or Monthly (12 months) intervals.
De-trending: Removes long-term linear bias from the data to isolate pure seasonal oscillations, ensuring the curve reflects cyclicality rather than just long-term trend.
Dynamic Scaling: Automatically scales the seasonal curve to match the price range of the currently visible bars for better visual alignment.
Future Projection: Plots the historical seasonal expectation into the future (the "empty" space to the right) to assist in cyclical forecasting.
Key Inputs
Lookback Period: Number of years included in the statistical average.
Smoothing (MA): Optional moving average applied to the seasonal curve to filter out noise.
Trading Days: Toggle between fixed (252) or variable calculation (useful for 24/7 or OTC markets).
Disclaimer: Past performance is not indicative of future results. Seasonality represents a statistical average of historical data and should not be used as a standalone signal for trading. Market conditions change, and historical cycles may fail to repeat due to fundamental shifts, black swan events, or changing market regimes. Use this tool only as a secondary filter within a comprehensive risk management strategy.
This script is a technical tool designed to identify and project historical price cycles onto the current chart. It calculates the average price movement for specific time intervals (days, weeks, or months) over a multi-year lookback period to highlight recurring seasonal patterns.
Technical Features
Historical Averaging: Aggregates price deltas ($Close - Close[1]$) for each calendar "slot" (e.g., Trading Day 1–252) over a user-defined period (up to 30 years).
Multi-Timeframe Support: Automatically adapts to Daily (252 days), Weekly (52 weeks), or Monthly (12 months) intervals.
De-trending: Removes long-term linear bias from the data to isolate pure seasonal oscillations, ensuring the curve reflects cyclicality rather than just long-term trend.
Dynamic Scaling: Automatically scales the seasonal curve to match the price range of the currently visible bars for better visual alignment.
Future Projection: Plots the historical seasonal expectation into the future (the "empty" space to the right) to assist in cyclical forecasting.
Key Inputs
Lookback Period: Number of years included in the statistical average.
Smoothing (MA): Optional moving average applied to the seasonal curve to filter out noise.
Trading Days: Toggle between fixed (252) or variable calculation (useful for 24/7 or OTC markets).
Disclaimer: Past performance is not indicative of future results. Seasonality represents a statistical average of historical data and should not be used as a standalone signal for trading. Market conditions change, and historical cycles may fail to repeat due to fundamental shifts, black swan events, or changing market regimes. Use this tool only as a secondary filter within a comprehensive risk management strategy.
Mã được bảo vệ
Tập lệnh này được đăng dưới dạng mã nguồn đóng. Tuy nhiên, bạn có thể sử dụng tự do và không giới hạn – tìm hiểu thêm tại đây.
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ã được bảo vệ
Tập lệnh này được đăng dưới dạng mã nguồn đóng. Tuy nhiên, bạn có thể sử dụng tự do và không giới hạn – tìm hiểu thêm tại đây.
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.