OPEN-SOURCE SCRIPT
Zfx Lunar Phase Engine

Zfx — Lunar Phase Engine
This indicator maps the synodic lunar cycle directly onto your price chart using precise astronomical timing. The lunar wave is calculated from a verified new moon epoch and plotted as a smooth sine oscillator on the left scale, allowing you to overlay the natural 29.5-day moon cycle against any market on any timeframe — without cluttering your price action.
What it does:
- Computes real-time lunar phase (0 = New Moon → 0.5 = Full Moon → 1 = back to New Moon) using the synodic month constant (2,551,442 seconds)
- Plots the wave on the left scale directly over price — candles remain fully readable
- Marks all four lunar phases with vertical lines and emoji anchors: 🌑 New Moon (cyan), 🌓 First Quarter, 🌕 Full Moon (gold), 🌗 Third Quarter
- Projects the next 3 upcoming phase events forward in time as dashed future lines
- Displays a live data table: current illumination % and days until the next New/Full Moon
- Optional waxing/waning background shading
Why it matters:
Lunar cycles have been studied in relation to market sentiment, liquidity windows, and turning points across commodities, indices, and crypto. This tool makes it effortless to visually correlate price behaviour with the moon's phase without any manual calculation.
Settings:
- Toggle quarter moon markers on/off
- Toggle background shading on/off
- Toggle the data table on/off
- All alert conditions included for all 4 phase transitions
Built for clean, uncluttered overlay use on any symbol and any timeframe.
---
That framing is distinct enough — it emphasises the astronomical calculation, the overlay approach, the left-scale design, and the forward projection, which differentiates it from generic lunar scripts.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.