Pine Script报错end of line without line continuation 求解决
TradingView Pine Script 报错解决:end of line without line continuation
错误原因
你这段多行拆分的if条件语句,每行末尾没加Pine Script要求的换行续行符\,编译器无法识别这是同一语句的延续,因此抛出错误。
修改后的代码
if (ta.candleColor(0) == 1 and \ high[1] > prevClose and \ low[0] < prevClose and \ currentOpen > prevClose) sellSignal := true
补充说明
- 在Pine Script里,把单个语句拆成多行写时,除最后一行外,其余每行末尾必须加
\,明确告知编译器代码未结束,下一行是语句延续。 - 也可以把所有条件写在同一行,但用续行符拆分多行能提升代码可读性。
内容的提问来源于stack exchange,提问作者meth dev
相关产品推荐
相关产品推荐

