OPEN-SOURCE SCRIPT
First X Days Of A Year

First X-Day Indicator
Overview
The "First X-Day Indicator" is a powerful tool to visualize and analyze market sentiment during the crucial first trading days of each new year. It provides immediate visual feedback on whether the year is starting with positive or negative momentum compared to the previous year's close, a concept often related to market theories like the "January Effect" or the "First Five Days Rule."
The indicator is designed to be clean, intuitive, and fully customizable to fit your charting style.
Key Features
Settings & Customization
You have full control over all visual elements:
Overview
The "First X-Day Indicator" is a powerful tool to visualize and analyze market sentiment during the crucial first trading days of each new year. It provides immediate visual feedback on whether the year is starting with positive or negative momentum compared to the previous year's close, a concept often related to market theories like the "January Effect" or the "First Five Days Rule."
The indicator is designed to be clean, intuitive, and fully customizable to fit your charting style.
Key Features
- Yearly Baseline: Automatically draws a horizontal line at the previous year's closing price. This line serves as a clear 0% reference for the current year's performance.
- Dynamic Background Coloring: For a user-defined number of days at the start of the year, the chart background is colored daily. Green indicates the close is above the previous year's close, while red indicates it's below.
- Final Performance Symbol: At the end of the analysis period (e.g., on the 5th day), a single summary symbol (like 👍 or 👎) appears. This symbol represents the final performance outcome of the initial trading period.
Settings & Customization
You have full control over all visual elements:
- Analysis Period: Define exactly how many days at the start of the year you want to analyze (e.g., 3, 5, or 10 days).
- Line Customization:Fully control the yearly baseline's appearance. You can change its color, width, and style (Solid, Dashed, or Dotted) or hide it completely.
- Symbol Customization: Choose any character or emoji for the positive and negative performance symbols. You can also adjust their size (Small, Normal, Large) or hide them.
- Background Control: Enable or disable the daily background coloring and select your preferred custom colors for positive and negative days.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.