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!
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.