pine-script - TradingView 的船体移动平均线指标的变化率
问题描述
我是 Pine Editor 的新手。谁能帮我为 TradingView 的船体移动平均线指标的变化率编写代码?它是一个非常有用的指标。谢谢
解决方案
您可以将内置船体移动平均线和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)
推荐阅读
- node.js - module.exports 返回值未定义
- javascript - 用于文件下载的 Javascript AJAX 调用 PHP 函数
- python - Python:按顺序运行 bash 命令
- node.js - 如何在 Windows 容器上对 React App 进行 dockerize
- c# - 获取用于数据库连接的底层 IP
- python-3.x - 反向词典理解方法不起作用
- laravel-5 - 缺少对 Laravel 数据透视表的理解
- android - 如何在不删除标签的情况下读取标签并在格式化后再次标签
- c - 在c中连接字符串的最有效方法
- refactoring - 你能在 Xcode 中重构函数参数的名称吗?