OPEN-SOURCE SCRIPT

Simple Moving Average 9 (1D)

82
//version=6
indicator("Simple Moving Average 9 (1D)", shorttitle="SMA9", overlay=true)

// Input for moving average period (set to 9 for 1-day)
moving_average = input.int(9, "Moving Average Period", minval=1)

// Input for source (default close)
src = input(close, "Source")

// Calculate SMA using 1-day data (chart timeframe)
sma_value = ta.sma(src, moving_average)

// Plot the SMA
plot(sma_value, color=color.blue, title="SMA 9 (1-Day)")

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.