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.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.