var x = '123'
x := x + '211'
plotshape(true, style=shape.labelup, color=close>open ?color.green:color.red, text= x, location=location.belowbar)
Run Code Online (Sandbox Code Playgroud)
将出现错误“第 39 行:无法使用plotshape参数调用(文字 bool、style=const string、color=series[color]、text=string、location=const string);可用的重载:plotshape(series [bool],const string,输入字符串,输入字符串,series [color],输入整数,series [integer],const string,series [color],const bool,const string,输入整数,字符串) => 无效;plotshape(fun_arg__,常量字符串,输入字符串,输入字符串,fun_arg__,输入整数,系列[整数],常量字符串,fun_arg__,常量布尔,常量字符串,输入整数,字符串)=> void'
plotshape()的text=参数需要一个const 字符串,并且您正在使用一系列字符串参数:
https://www.tradingview.com/pine-script-reference/v4/#fun_plotshape
//@version=4
study("", "", true)
barColor = close > open ? color.green : color.red
a = "Bar is\n" + (barColor == color.green ? "green" : "red")
if bar_index % 10 == 0
label.new(bar_index, na, a, yloc = yloc.belowbar, color = barColor, textcolor = barColor, style = label.style_triangleup)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3424 次 |
| 最近记录: |