Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/13.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 错误无法调用';交叉管';带参数(绘图、绘图);可用重载:crossunder(系列[float],系列[float])=>;系列[bool];_Pine Script - Fatal编程技术网

Pine script 错误无法调用';交叉管';带参数(绘图、绘图);可用重载:crossunder(系列[float],系列[float])=>;系列[bool];

Pine script 错误无法调用';交叉管';带参数(绘图、绘图);可用重载:crossunder(系列[float],系列[float])=>;系列[bool];,pine-script,Pine Script,您好,我在脚本中添加了以下行: 这个想法是,当这个图(a=)穿过(mplot=)时,我有一个警报。 但是我得到了这个错误代码:不能用参数(plot,plot)调用“crossunder”;可用重载:crossunder(series[float],series[float])=>series[bool] 有人能帮我一下吗?您不能在crossover()函数中使用绘图对象。 您必须使用它们所代表的值 绘图a表示close的值 绘图mplot表示mband的值 因此,您必须将代码更改为: a = p

您好,我在脚本中添加了以下行:

这个想法是,当这个图(a=)穿过(mplot=)时,我有一个警报。
但是我得到了这个错误代码:
不能用参数(plot,plot)调用“crossunder”;可用重载:crossunder(series[float],series[float])=>series[bool]


有人能帮我一下吗?

您不能在
crossover()
函数中使用绘图对象。
您必须使用它们所代表的值

绘图
a
表示
close
的值
绘图
mplot
表示
mband
的值

因此,您必须将代码更改为:

a = plot(close, color = color.white, transp = 100, title = "close") 

plotshape(crossover(close,  mband), style=shape.triangleup,   location=location.belowbar, size=size.tiny)
plotshape(crossunder(close, mband), style=shape.triangledown, location=location.abovebar, size=size.tiny)

alertcondition(crossover(close,  mband), title="Close Crossover")
alertcondition(crossunder(close, mband), title="Close Crossunder")
或者更有效地,计算一次
交叉/under
,并使用其结果,如下所示:

a = plot(close, color = color.white, transp = 100, title = "close") 

co = crossover(close,  mband)
cu = crossunder(close, mband)

plotshape(co, style=shape.triangleup,   location=location.belowbar, size=size.tiny)
plotshape(cu, style=shape.triangledown, location=location.abovebar, size=size.tiny)

alertcondition(co, title="Close Crossover")
alertcondition(cu, title="Close Crossunder")

谢谢你的帮助
a = plot(close, color = color.white, transp = 100, title = "close") 

co = crossover(close,  mband)
cu = crossunder(close, mband)

plotshape(co, style=shape.triangleup,   location=location.belowbar, size=size.tiny)
plotshape(cu, style=shape.triangledown, location=location.abovebar, size=size.tiny)

alertcondition(co, title="Close Crossover")
alertcondition(cu, title="Close Crossunder")