Pine script pine脚本4:变量';购买信号&x27;以';系列[整数]';类型无法为其指定类型为';系列[bool]和#x27;

Pine script pine脚本4:变量';购买信号&x27;以';系列[整数]';类型无法为其指定类型为';系列[bool]和#x27;,pine-script,Pine Script,如何将以下两行转换为pine脚本的版本4: isBuyPlotted=nz(buySetup)==9?false:buySignal[1]==true or isBuyPlotted[1]==true?true:nz(buySetup[MAXSIGNALDELAY+1])==9?true:false // init buySignal:=nz(buySetup[MAXSIGNALDELAY])>9-MAXSIGNALDELAY and close>nz(high[1]) and nz

如何将以下两行转换为pine脚本的版本4:

isBuyPlotted=nz(buySetup)==9?false:buySignal[1]==true or isBuyPlotted[1]==true?true:nz(buySetup[MAXSIGNALDELAY+1])==9?true:false // 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

谢谢

所有上下文都不在您的代码段中,但这应该可以:

isBuyPlotted = false
isBuyPlotted := nz(buySetup)==9?false:buySignal[1]==true or isBuyPlotted[1]==true?true:nz(buySetup[MAXSIGNALDELAY+1])==9?true:false // init
buySignal = false
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

非常感谢。我完全分析过度了。我没有指定true或false,而是指定了1或0个值。哼!