TVC:GOLD   CFDs on Gold (US$ / OZ)
//@version=4
study(title="Moving Average Example", shorttitle="MA Example", overlay=true)

// Thiết lập độ dài của Moving Average
length = input(20, minval=1, title="Length")

// Tính toán giá trị trung bình động
sma_value = sma(close, length)

// Hiển thị giá trị trung bình động trên biểu đồ
plot(sma_value, color=color.blue, linewidth=2, title="Moving Average")
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.