OPEN-SOURCE SCRIPT

Gold Price with Time Shift

198
Overview
The "Gold Price with Time Shift" indicator allows you to visualize the Gold price (XAUUSD) with a customizable time shift, enabling you to lag or lead the data by a specified number of bars. Whether you're analyzing historical trends or projecting Gold’s price into the future, this indicator provides a flexible tool to align Gold price movements with other market indicators or events.
Features
Customizable Time Shift: Shift the Gold price backward (lag) or forward (lead) by a user-defined number of bars. Positive values lag the data, while negative values project it into the future.

Future Projection: When leading the Gold price (negative time shift), the indicator extends the chart into the future, displaying the last known price as a flat projection for easy comparison.

Daily Timeframe: Fetches Gold price data on a daily timeframe, ensuring consistency for long-term analysis.

User-Friendly Inputs: Easily adjust the Gold ticker and time shift via the settings panel to suit your analysis needs.

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.