Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/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 如何正确使用Alertcondition功能,我做错了什么?_Pine Script - Fatal编程技术网

Pine script 如何正确使用Alertcondition功能,我做错了什么?

Pine script 如何正确使用Alertcondition功能,我做错了什么?,pine-script,Pine Script,我正在尝试使用脚本中的alerts函数。我是一个不懂编码的人,我想修改一些现有的东西 //警报 plotshape(longCondition, title = "Buy Signal", text ="LONG", textcolor = white, style=shape.labelup, size = size.normal, location=location.belowbar, color = green, transp = 0) plotshape(shortCondition,

我正在尝试使用脚本中的alerts函数。我是一个不懂编码的人,我想修改一些现有的东西

//警报

plotshape(longCondition, title = "Buy Signal", text ="LONG", textcolor = white, style=shape.labelup, size = size.normal, location=location.belowbar, color = green, transp = 0)
plotshape(shortCondition, title = "Sell Signal", text ="SHORT", textcolor = white, style=shape.labeldown, size = size.normal, location=location.abovebar, color = red, transp = 0)

alertcondition(longCondition,title="Long",message="Long @ ..")
alertcondition(shortCondition,title="Short",message="Short @ .. ")
我希望当策略有买入预警时,多头预警是可选择的,反之亦然

如果有人能在这方面帮助我,我会非常感激

当我想用tradingview创建警报时,策略是可编译的,但没有可选择的


谢谢

您不能使用策略以这种方式创建警报。请参阅以了解警报如何用于策略