转换Pine脚本V2到V3
这是我的代码。
isBuyPlotted=isBuyPlotted[1]==true?true:nz(buySetup[MAXSIGNALDELAY+1])==9?true:false or nz(buySetup)==9?false:buySignal[1]==true // init
buySignal=nz(buySetup[MAXSIGNALDELAY])>9-MAXSIGNALDELAY and close>nz(high[1]) and nz(close[1])>nz(open[1]) and nz(close)>nz(open) and not isBuyPlotted
我尝试修改Pine版本2至版本3。
isBuyPlotted=0.0
isBuyPlotted:=isBuyPlotted[1]==true?true:nz(buySetup[MAXSIGNALDELAY+1])==9?true:false or nz(buySetup)==9?false:buySignal[1]==true // init
buySignal=0.0
buySignal:=nz(buySetup[MAXSIGNALDELAY])>9-MAXSIGNALDELAY and close>nz(high[1]) and nz(close[1])>nz(open[1]) and nz(close)>nz(open) and not isBuyPlotted
但是此错误发生。 变量BuySignal
用浮点类型声明。无法分配类型系列的表达[bool]
This is my code.
isBuyPlotted=isBuyPlotted[1]==true?true:nz(buySetup[MAXSIGNALDELAY+1])==9?true:false or nz(buySetup)==9?false:buySignal[1]==true // init
buySignal=nz(buySetup[MAXSIGNALDELAY])>9-MAXSIGNALDELAY and close>nz(high[1]) and nz(close[1])>nz(open[1]) and nz(close)>nz(open) and not isBuyPlotted
I try to modify pine version 2 to version 3.
isBuyPlotted=0.0
isBuyPlotted:=isBuyPlotted[1]==true?true:nz(buySetup[MAXSIGNALDELAY+1])==9?true:false or nz(buySetup)==9?false:buySignal[1]==true // init
buySignal=0.0
buySignal:=nz(buySetup[MAXSIGNALDELAY])>9-MAXSIGNALDELAY and close>nz(high[1]) and nz(close[1])>nz(open[1]) and nz(close)>nz(open) and not isBuyPlotted
But this error happens.
Variable buySignal
was declared with float type. Cannot assign it expression of type series[bool]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这两个变量均为
bool
在原始代码中,但您已将其声明为float
。这就是错误消息告诉您的。将其更改为:
Both those variables are of type
bool
in the original code but you have declared them asfloat
. That's what the error message tells you.Change it to: