OPEN-SOURCE SCRIPT
Obsidians Gold Revenge

Many traders (including institutional desks) track lunar cycles on Gold (XAUUSD) because of the psychological impact on market sentiment. The common theory—often attributed to methods like Gann analysis—is:
🌑 New Moon: Often correlates with Market Bottoms (Buy Signals) or "New Beginnings."
🌕 Full Moon: Often correlates with Market Tops (Sell Signals) or "Exhaustion."
Here is a script that mathematically calculates the Moon Phase based on the lunar synodic month (approx. 29.53 days). It will plot these events on your chart so you can visually backtest if Gold respects these cycles.
How to use this for testing
Add it to your Chart: Apply it to the XAUUSD (Gold) chart.
Timeframe: This works best on 4-Hour (4H) or Daily (1D) charts. (On 15m charts, the moon phase covers many candles, so the label will appear on the specific candle where the phase officially "switched").
What to look for:
Look at the Dark Blue (New Moon) areas. Did price form a bottom or start a rally there?
Look at the Yellow (Full Moon) areas. Did price peak and reverse downward there?
Note: Lunar cycles are considered a "timing tool" rather than a directional indicator. They often indicate when a reversal might happen, but you should combine this with your Institutional Candle zones to confirm the direction!
🌑 New Moon: Often correlates with Market Bottoms (Buy Signals) or "New Beginnings."
🌕 Full Moon: Often correlates with Market Tops (Sell Signals) or "Exhaustion."
Here is a script that mathematically calculates the Moon Phase based on the lunar synodic month (approx. 29.53 days). It will plot these events on your chart so you can visually backtest if Gold respects these cycles.
How to use this for testing
Add it to your Chart: Apply it to the XAUUSD (Gold) chart.
Timeframe: This works best on 4-Hour (4H) or Daily (1D) charts. (On 15m charts, the moon phase covers many candles, so the label will appear on the specific candle where the phase officially "switched").
What to look for:
Look at the Dark Blue (New Moon) areas. Did price form a bottom or start a rally there?
Look at the Yellow (Full Moon) areas. Did price peak and reverse downward there?
Note: Lunar cycles are considered a "timing tool" rather than a directional indicator. They often indicate when a reversal might happen, but you should combine this with your Institutional Candle zones to confirm the direction!
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que la republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que la republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.