PROTECTED SOURCE SCRIPT

Seasonality-by-Atrader

44


Seasonality Extended – Enhanced Historical Monthly Pattern Analysis

This script is a comprehensive extension of the original Seasonality concept, designed to analyze historical monthly returns of any asset on TradingView. It introduces advanced filtering, visualization, and usability features that significantly expand upon the capabilities of the original version.

Overview

The script calculates month-over-month percentage changes for each year, starting from a user-defined year. Results are displayed both on the chart as projected return boxes and in a data-rich heatmap table that highlights monthly trends, average returns, standard deviation, and the percentage of positive months.

Key Enhancements

  1. Year-Based Filtering


Users can selectively include:
  • Only years ending in specific digits (e.g., 1, 3, 7)
  • Only every n-th year (e.g., every 4th year from a reference year)
  • Both filters can be combined for precise cycle isolation


  1. Exclusion of Irregular Periods


  • Specific months can be excluded from the analysis using a date-based input (e.g., 2008-10, 2020-03)
  • This allows users to remove outliers or crisis periods from historical performance data


  1. Enhanced Heatmap Display


  • Adapts to year filters automatically
  • Resizable via input fields for width and height
  • Table can be positioned (left, center, or right)
  • Optional summary rows for averages, standard deviations, and percentage of positive months


  1. Custom Color Configuration


  • Separate color selection for positive and negative returns
  • Customizable gradient intensity threshold


  1. Asset Compatibility


  • Works across all TradingView-supported asset classes (stocks, indices, futures, crypto, forex)
  • Supports multi-decade data where available (e.g., TVC:DXY from the 1970s)


  1. On-Chart Seasonality Projection


  • Displays expected return zones for the current month based on historical data
  • Shows projected price range and statistical context (standard deviation, sample size)


Use Cases

  • Analyzing recurring seasonal behavior
  • Isolating macro or election-cycle influences
  • Informing strategic trade planning based on historical patterns


Limitations

  • Table size is adjusted via inputs only (no mouse drag-resize)
  • Analysis is based on monthly timeframes exclusively
  • Chart object count is limited by TradingView’s standard restrictions


Summary

This script offers a refined and practical approach to seasonality analysis by enabling deep historical filtering, cycle-specific inclusion, and comprehensive tabular and visual output. It is tailored for analysts and traders looking to integrate long-term seasonal tendencies into their decision-making framework.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน