OPEN-SOURCE SCRIPT

MA

30
//version=5
indicator("MA20 và EMA9", overlay=true)

// === Input tham số ===
lengthMA = input.int(20, "Độ dài MA", minval=1)
lengthEMA = input.int(9, "Độ dài EMA", minval=1)

// === Tính toán đường trung bình ===
ma20 = ta.sma(close, lengthMA) // Simple Moving Average 20
ema9 = ta.ema(close, lengthEMA) // Exponential Moving Average 9

// === Vẽ ra biểu đồ ===
plot(ma20, color=color.red, linewidth=2, title="MA20")
plot(ema9, color=color.blue, linewidth=2, title="EMA9")

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.