Pine script PinScript:如何在条形图下方/上方设置一个具有一定距离的plotshape标签?
如何将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
您可以使用
\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