OPEN-SOURCE SCRIPT

IPDA Time (3, 6, 9) [Final v3]

104
This Pine Script code defines a custom TradingView indicator called "IPDA Time (3, 6, 9)". It is designed to identify specific bars on the chart where the digital root of the current time (hour and minute) equals 3, 6, or 9, which are numbers often associated with cycles and market timing concepts in trading.

1. What the Code Does
The script calculates two main time values based on a concept known as the Digital Root (also called the "Digital Sum").

The Digital Root Function
The core logic uses a custom function, getDigitalRoot(number), which calculates the digital root of any number. The digital root is the single digit obtained by an iterative process of summing the digits of a number, repeatedly until a single digit is reached (e.g., the digital root of 48 is 4+8=12→1+2=3).

Signal Calculations
The script extracts the individual digits from the current chart's hour and minute (h, m) and performs two distinct digital root calculations:

hourPlusMinuteValue (High Confluence Check): Calculates the digital root of the sum of all four digits (two from the hour, two from the minute).

minuteOnlyValue (Minute Check): Calculates the digital root of the sum of the two minute digits only.

Logic and Signal Generation
The code generates three types of signals based on whether these digital roots equal 3, 6, or 9:

High-Importance (Green Square): Generated when BOTH the "Hour + Minute" check (isHourPlusMinuteSignal) and the "Minute Only" check (isMinuteOnlySignal) are true.

Hour + Minute Only (Blue Diamond): Generated when ONLY the "Hour + Minute" check is true.

Minute Only (Yellow Diamond): Generated when ONLY the "Minute Only" check is true.

2. Visual Output on the Chart
The indicator visualizes these signals directly on the price chart:

Signal Type Shape (Style) Color Location Additional Effect
High-Importance Square (shape.square) Green Above Bar Changes the bar's color to green (with 75% transparency).
Hour + Minute Only Diamond (shape.diamond) Blue Above Bar N/A
Minute Only Diamond (shape.diamond) Yellow Above Bar N/A

Export to Sheets
The visual markers appear above the bar/candle that corresponds to the specific time criteria being met, highlighting moments the indicator's logic deems significant.












Tools

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.