如何在pinescript中创建自定义的简单移动平均线



我想在Pine for Tradingview中创建一个简单的移动平均线。

移动平均线是13期高点、13期低点、65期高点和65期低点的平均值。(所以这4个数字除以4(

有人能帮忙吗?

谢谢,CT

//@version=5
indicator("myavg", overlay = true)
h13 = ta.highest(high, 13)
l13 = ta.lowest(low, 13)
h65 = ta.highest(high, 65)
l65 = ta.lowest(low, 65)
myAvg = math.avg(h13, l13, h65, l65)
plot(myAvg)

最新更新