Tool
Lunar Phase
market.lunar_phase
Inputs
No typed inputs.
Outputs
A bundle carrying the lunar phase (0 = new moon, 0.5 = full moon, approaching 1 = back toward new) along with the Moon's longitude and zodiac sign. Read the phase to time around new and full moons.
Lunar phase tells you where the Moon is in its cycle on each bar — from new moon through full moon and back. Some traders treat new and full moons as recurring turning dates and use this to time entries around them.
How it works
For each bar's date the tool computes the Moon's position relative to the Sun and turns it into a phase number from 0 to 1, where 0 is a new moon and 0.5 is a full moon. The `frame` sets whether positions are measured from Earth or the Sun, and `zodiac` sets whether the Moon's sign is read in the tropical or sidereal zodiac. The output bundle carries the phase plus the Moon's longitude and sign.
Modes
Frame options
Measures the Moon's position from Earth — the natural, conventional frame for lunar phase, since phase is literally how the Moon looks from Earth.
When to use: The default and the right choice for actual moon phases; use it unless you specifically need a Sun-centred reading.
Measures positions from the Sun instead of Earth. Phase as such only makes sense from Earth, so this is a non-standard frame offered for consistency with the other astro tools.
When to use: Only when you deliberately want a Sun-centred longitude rather than the literal Earth-seen phase.
Zodiac options
Reports the Moon's sign in the tropical zodiac, which is tied to the seasons and the spring equinox — the system used by most Western astrology.
When to use: The default; use tropical for the conventional Western sign of the Moon.
Reports the Moon's sign in the sidereal zodiac, which is fixed to the actual constellations — offset from tropical by the precession of the equinoxes (about 24 degrees).
When to use: Use sidereal when you want the sign aligned to the real star background, as in Vedic astrology.
Configuration
The vantage point for the Moon's position: geocentric (from Earth, the natural choice for phase) or heliocentric (from the Sun).
Which zodiac to report the Moon's sign in: tropical (season-based, standard in Western astrology) or sidereal (fixed to the constellations, used in Vedic astrology).
Connects to
Examples
- New-moon timing: read the phase with feature.read_scalar and allow entries only when it is near 0 (a new moon).
- Full-moon avoidance: block new positions in the bars around phase 0.5 if your testing shows weaker follow-through there.
Common mistakes
- Reading the phase number as a price level — it is a 0-to-1 position in the lunar cycle, useful only for timing.
- Choosing the heliocentric frame for actual moon phases — phase is an Earth-seen quantity, so geocentric is the correct frame.