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.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน