First X Days Of A YearFirst 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
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.
Effect
Offset ProjectIntended for use with CPI symbols like:
CPIAUCNS (all items)
CPILFENS (core)
Shows the CPI values from a year ago, next to the current values. This makes it easier to visualize the base effects .
Has a ' max inflation rate ' parameter. This is shown as a red line. So for example, if it's set to 3, then CPI must stay below the red line in in order for the inflation rate to stay below 3.
[CLX] Library Motion - Examples📑 Showcase
This is ready-to-show indicator version of the example code form the `motion` library. It can be used to create string- or color-based effects.
Library:
================================================================================
📑 Setup
To use this library in your own scripts, you must first import it. To do this, add the following line to the top of your script:
import cryptolinx/Motion/1 as motion
Next, create a `keyframe` object by using the `varip` keyword.
varip myKeyframe = motion.keyframe.new(_intv = 1, _steps = 1)
Based on your needs, you can now use one of the simplified functions to create a transition effect, or you can use the `transition()` or `iteration()` function to create a custom transition effect.
📑 Simplified Functions:
(direct output)
// motion.marquee(keyframe myKeyframe, string _seq, int _ws, int _maxLoops, bool _ltr)
motion.marquee(myKeyframe, 'Hello World!', 3, 0) // 0 = infinite loops
// motion.slideInLeft(keyframe myKeyframe, string _seq, int _ws, int _maxLoops, bool _refill)
motion.slideInLeft(myKeyframe, 'Hello World!', 3, 0) // 0 = infinite loops
// motion.slideOutLeft(keyframe myKeyframe, string _seq, int _ws, int _maxLoops, bool _refill)
motion.slideOutLeft(myKeyframe, 'Hello World!', 3, 0) // 0 = infinite loops
// motion.slideInRight(keyframe myKeyframe, string _seq, int _ws, int _maxLoops, bool _refill)
motion.slideInRight(myKeyframe, 'Hello World!', 3, 0) // 0 = infinite loops
// motion.slideOutRight(keyframe myKeyframe, string _seq, int _ws, int _maxLoops, bool _refill)
motion.slideOutRight(myKeyframe, 'Hello World!', 3, 0) // 0 = infinite loops
// motion.blink(keyframe myKeyframe, string _seq, int _ws, int _maxLoops)
motion.blink(myKeyframe, 'Hello World!', 3, 0) // 0 = infinite loops
(indirect output)
// After you create a transition, you can use the `output` field of the `keyframe` object to get the result.
// motion.marquee(myKeyframe, 'Hello World!', 3, 0)
myKeyframe.output



