Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/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 PinScript:如何在条形图下方/上方设置一个具有一定距离的plotshape标签?_Pine Script - Fatal编程技术网

Pine script PinScript:如何在条形图下方/上方设置一个具有一定距离的plotshape标签?

Pine script PinScript:如何在条形图下方/上方设置一个具有一定距离的plotshape标签?,pine-script,Pine Script,如何将plotshape标签设置在具有一定距离的条的下方/上方?就像下面的截图。 您可以使用\n 例如: plotchar(dcc,title=“乌云覆盖”,char=”☁", location=location.top,color=color.orange,text=“.\n.\Dcc”) plotshape(test,title=“test”,style=shape.circle,location=location.belowbar,color=color.red,text=“test\n

如何将plotshape标签设置在具有一定距离的条的下方/上方?就像下面的截图。


您可以使用
\n

例如:

plotchar(dcc,title=“乌云覆盖”,char=”☁", location=location.top,color=color.orange,text=“.\n.\Dcc”)

plotshape(test,title=“test”,style=shape.circle,location=location.belowbar,color=color.red,text=“test\n\n”)

//@version=4
study("My Script", overlay = true)

ema1 = ema(close, 13)
ema2 = ema(close, 50)

condition = crossover(ema1, ema2)

plot(ema1)
plot(ema2)

// 
atr_dist = atr(14) //atr distance
perc_dist = input(2.0, "Distance in %:") //% distance

if condition
    // label.new(bar_index, high + atr_dist, "Above", style=label.style_label_down, color = color.green)
    label.new(bar_index, high + high *perc_dist /100, "Above", style=label.style_label_down, color = color.green) //or use % as distance
    // label.new(bar_index, high - atr_dist, "Below", style=label.style_label_up, color = color.red)
    label.new(bar_index, low - low *perc_dist /100, "Below", style=label.style_label_up, color = color.red) //or use % as distance