OANDA:XAUUSD   Gold Spot / U.S. Dollar
This Script code creates a TradingView indicator that changes the chart's background color based on the relationship between the close price and the Simple Moving Average (SMA) across multiple time frames (15-min, 60-min, and 4-hour). The user can customize the SMA period and the time frames.

Features:
User Inputs: The script allows users to input their preferred SMA period and time frames.
Multiple Time Frames Analysis: It evaluates the close prices against the SMA in three user-defined time frames.
Dynamic Background Coloring: The chart's background color changes dynamically to represent different market trends. The color intensities vary, signifying whether the price is above or below the SMA across one, two, or all three selected time frames.
Colors Representation:
Above SMA Conditions:
Light Green: Price is above the SMA in the first time frame only.
More Green (Darker Shade): Price is above the SMA in both the first and second time frames.
Dark Green: Price is above the SMA in all three time frames.
Below SMA Conditions:
Light Red: Price is below the SMA in the first time frame only.
More Red (Darker Shade): Price is below the SMA in both the first and second time frames.
Dark Red: Price is below the SMA in all three time frames.
Default:
Gray: For any other condition not met by the above.
Usage:
This indicator assists traders in visualizing the market trend across different time frames concurrently. It provides a quick visual reference, helping traders make informed decisions based on the prevailing trend and its strength across various time frames. Always conduct thorough research and consider seeking advice from financial consultants before making trading decisions, as the script is not a foolproof indicator for trading opportunities.
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.