Tradingview_pine脚本_三条ma
Tradingview 未付费用户有只能用三个指标的限制,如果我想看ma 20,60,120 就把资源都占用了。 利用pine编辑器6行代码节省资源,变成只占用一个指标。
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © hrbhot
//@version=4
study(title = "MA 20 & 60 & 120", overlay = true)
short = sma (close,20) //代表MA 20
mid = sma (close,60) //代表MA 60
long = sma (close,120) //代表MA 120
plot(short, color =#FF8C00, linewidth = 3)
plot(mid, color =#FF4500, linewidth =3)
plot(long, color =#C0C0C0, linewidth = 3)
把代码内 short,mid,long 换成自己需要的周期即可。