TradingView 的 Hull 移动平均指标变化率

Rate of Change of Hull Moving Average Indicator for TradingView

我是 Pine Editor 的新手。任何人都可以帮我编写 TradingView 的 Hull 移动平均指标变化率代码吗?这是一个非常有用的指标。谢谢

您可以结合内置的船体移动平均线和 roc 函数,如下例所示

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © e2e4mfck

//@version=4
study("Rate of Hull Change", overlay = false)

// Inputs
i_hullLength    = input(9, "Hull Length", minval=1)
i_rocLength     = input(1, "Rate of Change Length", minval=1)
i_src           = input(close, title="Source")

hullma  = wma(2*wma(i_src, i_hullLength/2)-wma(i_src, i_hullLength), round(sqrt(i_hullLength)))
rocHull = roc(hullma, i_rocLength)

plot(rocHull)