首页 > 解决方案 > 如何修改系列的情节?

问题描述

我正在使用下面的脚本绘制值。我怎样才能更新它以使该系列的数量更大?我不想改变 len,只是让它变宽 50 点。

谢谢,

//@version=4
study("Linear Regression Channel",shorttitle="LRC_SH",overlay=true)
len = input(300,title="Length")

smoothLen = 50
upper = sma(high, smoothLen) 
lower = sma(low,smoothLen)

a = linreg(upper,len,0)
b = linreg(lower,len,0)
c = -dev(low,len)+b
d = dev(high,len)+a //test 

//plot(a) //middle line
//plot(b) //middle line
plot(c,color=c>c[1]? color.green:color.red)
plot(d,color=d>d[1]? color.green:color.red)

标签: pine-script

解决方案


好的,我想通了。一种方法是:

theHigh = high
theLow = low


float coeff =.005
theHigh := high + (coeff * high)
theLow  := low  - (coeff * low)

推荐阅读