Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Pine script 在“移动平均线”上画水平线;“松树文字”;_Pine Script - Fatal编程技术网

Pine script 在“移动平均线”上画水平线;“松树文字”;

Pine script 在“移动平均线”上画水平线;“松树文字”;,pine-script,Pine Script,如何使用EMA8后面的pine脚本输出水平线。您应该做一个小的计算,并在所需的时间打印该行,价格在右侧 EMA 8(关闭)减去ATR(14)的1/2=行输出。要减去ATR,可以调用内置的ATR函数 atr14 = atr(14) 要绘制水平光线,可以设置plot函数的trackprice参数。但是,它也会将线延伸到左侧 //@version=3 study("LINE", overlay=true) ma_len = 8 src = close res = &quo

如何使用EMA8后面的pine脚本输出水平线。您应该做一个小的计算,并在所需的时间打印该行,价格在右侧


EMA 8(关闭)减去ATR(14)的1/2=行输出。

要减去ATR,可以调用内置的
ATR
函数

atr14 = atr(14)
要绘制水平光线,可以设置
plot
函数的
trackprice
参数。但是,它也会将线延伸到左侧

//@version=3 
study("LINE", overlay=true) 
ma_len = 8 
src = close 
res = "D" 
htf_ma = sma(src, ma_len) 
out = security(tickerid, res, htf_ma) 
plot(out, color=red, show_last=1, linewidth=3)

atr14 = atr(14)
plot(out - (atr14/2), color=red, linewidth=3, show_last=1, trackprice = true)

/@version=3研究(“LINE”,overlay=true)ma_len=8 src=close res=“D”htf_ma=sma(src,ma_len)out=security(tickerid,res,htf_ma)plot(out,color=red,show_last=1,linewidth=3)我已经在这里试过了。需要一条实线,我想减去ATR14值的一半。