Lunar Phases Advanced Pane

Added Benefits of the Lunar Phases in Pane form:
-Oscillator representing Lunar-Earth Distance and Declination with event markers
-Data fields for true Lunar-Earth Distances and Declinations for easy use in connected scripts.
-Declination values normalized to median Distance. Rising/Falling above and below where median = 0.00° from Earth's ecliptic plane.
-Phase based line color change on Distance oscillator, increasing data density for better visual reference
Our Beautiful Companion in the Night:
At New Moon, the Moon sits between Earth and the Sun. The Near side is completely dark, so the Moon is unseen (except during a solar eclipse). At Full Moon, the Near side of the Moon is on the opposite side of Earth from the Sun, so sunlight hits the entire face we see—creating that big, beautifully bright Ball in the night sky. Due to tidal locking, we never see the Far side of the moon from Earth's surface.
Right after New Moon, a thin Waxing Crescent appears low in the western sky at dusk, growing into the half-lit First Quarter, then a bulging Waxing Gibbous until reaching Full Moon which rises exactly as the Sun sets. After Full, it shrinks through Waning Gibbous, Last Quarter (half-lit visible in the early morning sky), finishing with a Waning Crescent (thin sliver again) just before disappearing at dawn for the next New Moon.
The Moon’s orbit is elliptical, so its distance from Earth varies. When Full and near Perigee(closest approach) it appears larger and up to 30% brighter leading way to the name, Super Moon. Near Apogee(farthest distance) the Moon will look smaller and dimmer, or Micro Moon. These extreme alignments tend to cluster in "seasons" because the point of closest approach slowly drifts around the orbit, completing a full cycle every 18.6 years.
Chart zoomed out to highlight the seasonal SuperMoon behavior because of Distance at event:
This indicator places markers on the distance oscillator in the pane for every New/Full Moon. SuperMoon events use larger circles, MicroMoon events use smaller ones (both optional based on distance at event). Distance line color change by Phase, with option for progressive shading:
Precise Perigee (closest approach) and Apogee (farthest away) markers optionally appear on the Distance oscillator line as red diamonds for Perigee and green diamonds for Apogee.
Red line shows the historical minimum, Green line shows the historical maximum for Lunar-Earth Distance. Grey line shows the historical Median distance and/or dynamic Median given the 'Start Date' input to current bar time window. Chart with Apogee/Perigee markers on the Distance oscillator line with Phase based color change:
Chart with Declination enabled as purple line, normalized to the grey Median Distance line as 0.00 from Earths Ecliptic plane with Phase markers on Distance line. The 2 example, vertical lines show when distance extreme is aligned or apposing the declination extreme(1/4 cycle). This Lunar Apsides Precession behavior leads to the tracing of the SuperMoon and Eclipse seasons by 40.7° annually, completing 1 full cycle every 8.85 year cycle(~3,232 days):
The Lunar Apsides Precession refers to the slow rotation of the Moon's elliptical orbit's major axis (the line connecting perigee and apogee) in the direction of the Moon's motion, completing a full 360° cycle in approximately 8.85 years (about 3,232 days). This prograde precession occurs primarily due to gravitational perturbations from the Sun, which exerts tidal forces that torque the Moon's orbit, causing the apsides to advance by roughly 40.7° per year, resulting in the observed period that modulates the timing and magnitude of extreme perigees SuperMoons, and Eclipse Seasons over multi-year cycles.
Extended Functionality
This Advanced Pane version builds on the core Lunar Phase detection by adding Lunar orbital Distance and Declination represented as an oscillator on Pane with data values for easy connection to other scripts like the Universal BackTester:
Accuracy:
New and Full Moon times are typically within ±few minutes
Distances are typically within ±10–100 km ±few minutes
Declination values are typically within ±0.01° of astronomically true, normalized to median distance as 0.00°
The Info Table:
Current — live phase name, live geocentric distance, live Declination value
Next Phase — upcoming New or Full Moon, countdown timer, and expected distance
Next Extreme — upcoming Perigee or Apogee, countdown timer, and expected distance
Settings:
Thresholds group:
- "Full"/"New" checkboxes turn SuperMoon and MicroMoon individually on or off for each
- Distance inputs let you set your own km cutoffs for what counts as super or micro (defaults are common values around 369,000 km and 405,000 km)
- Start Date and End Date control the time range the script scans for events (default 2010–2028)
Distance Boundaries:
- "Perigee Extreme" checkbox On/Off with color picker
- "Mid" for Median line with options for dynamic range from "Start Date" input to current
- "Apogee Extreme" checkbox On/Off with color picker
Distance Oscillator:
- "Declination" checkbox with color picker, and visual amplifier input to adjust the oscillation magnitude for enhanced visual reference
Phase Color Shading:
- "New Shade/Full Shade" checkbox turns the Waxing/Waning line shade colors On/Off
- Color pickers let you choose your own Waxing and Waning colors and shading step
Marker Settings:
- "New/Full" marker checkbox with color pickers
- "Peri/Apo" marker checkbox with color pickers
Information group:
- "Show Info Table" turns the vertical panel On/Off. Text Size dropdown
- "(New/Full)" checkbox adds detailed labels directly on New/Full bars with user selected time-zone, distance
- "(Peri/Apo)" checkbox adds detailed labels directly on Peri/Apo bars with user selected time-zone, distance
- Drop down time-zone for labels
Powered by multiple 50-term approximations of the ELP2000-82B lunar theory.
Disclaimer: The script was developed with assistance from Grok 4.1, always under human supervision and decision-making.
Script su invito
Solo gli utenti approvati dall'autore possono accedere a questo script. È necessario richiedere e ottenere l'autorizzazione per utilizzarlo. Tale autorizzazione viene solitamente concessa dopo il pagamento. Per ulteriori dettagli, seguire le istruzioni dell'autore riportate di seguito o contattare direttamente telephonejack.
TradingView NON consiglia di acquistare o utilizzare uno script a meno che non si abbia piena fiducia nel suo autore e se ne comprenda il funzionamento. È inoltre possibile trovare alternative gratuite e open source nei nostri script della community.
Istruzioni dell'autore
Crystal Ball Tech Discord server to join the discussion: discord.gg/B2HsGY5KrQ
Declinazione di responsabilità
Script su invito
Solo gli utenti approvati dall'autore possono accedere a questo script. È necessario richiedere e ottenere l'autorizzazione per utilizzarlo. Tale autorizzazione viene solitamente concessa dopo il pagamento. Per ulteriori dettagli, seguire le istruzioni dell'autore riportate di seguito o contattare direttamente telephonejack.
TradingView NON consiglia di acquistare o utilizzare uno script a meno che non si abbia piena fiducia nel suo autore e se ne comprenda il funzionamento. È inoltre possibile trovare alternative gratuite e open source nei nostri script della community.
Istruzioni dell'autore
Crystal Ball Tech Discord server to join the discussion: discord.gg/B2HsGY5KrQ