OPEN-SOURCE SCRIPT
SafeIN - Settlement & Variations

This indicator calculates a custom daily "Settlement" (or anchor price) specifically optimized for trading XAUUSD (Gold). Instead of relying on the standard daily open or close, it establishes a daily pivot based on a specific 1-minute high-volume window.
**Why this indicator was created:**
Unlike Gold Futures (GC) on the CME, which have an official exchange-mandated daily settlement price, spot Gold (XAUUSD) is traded as a CFD over-the-counter (OTC) without a centralized daily close. This indicator bridges that gap by generating a highly reliable daily anchor—simulating a futures-style settlement on your standard XAUUSD chart.
**What it does:**
In the Forex and commodities markets, specific times of the day experience a massive influx of liquidity (such as market overlaps or specific fixing times). This script isolates a specific 1-minute time window (13:29 to 13:30 by default, based on the selected timezone) and calculates a Volume Weighted Average Price (VWAP) using historical data for that exact minute. This creates a highly reliable daily anchor price, plotting a continuous horizontal line for the rest of the trading session.
**Key Features:**
* **Custom VWAP Anchor:** Computes a daily anchor price using a specific 1-minute volume-weighted window, avoiding the noise of standard daily candle closes.
* **Percentage Variations:** Automatically projects up to 5% positive and negative zones originating from the settlement price. These bands act as major intraday support and resistance levels for Gold traders.
* **Manual Override:** Allows users to input a custom settlement price manually if they wish to anchor the percentage bands to a different key price level or historical pivot.
* **Clean Visuals:** Lines and labels are dynamically plotted for the current day only, keeping your XAUUSD charts clean and easy to read without historical clutter.
**Why this indicator was created:**
Unlike Gold Futures (GC) on the CME, which have an official exchange-mandated daily settlement price, spot Gold (XAUUSD) is traded as a CFD over-the-counter (OTC) without a centralized daily close. This indicator bridges that gap by generating a highly reliable daily anchor—simulating a futures-style settlement on your standard XAUUSD chart.
**What it does:**
In the Forex and commodities markets, specific times of the day experience a massive influx of liquidity (such as market overlaps or specific fixing times). This script isolates a specific 1-minute time window (13:29 to 13:30 by default, based on the selected timezone) and calculates a Volume Weighted Average Price (VWAP) using historical data for that exact minute. This creates a highly reliable daily anchor price, plotting a continuous horizontal line for the rest of the trading session.
**Key Features:**
* **Custom VWAP Anchor:** Computes a daily anchor price using a specific 1-minute volume-weighted window, avoiding the noise of standard daily candle closes.
* **Percentage Variations:** Automatically projects up to 5% positive and negative zones originating from the settlement price. These bands act as major intraday support and resistance levels for Gold traders.
* **Manual Override:** Allows users to input a custom settlement price manually if they wish to anchor the percentage bands to a different key price level or historical pivot.
* **Clean Visuals:** Lines and labels are dynamically plotted for the current day only, keeping your XAUUSD charts clean and easy to read without historical clutter.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.