You need to enable JavaScript to run this app. Pine Script报错end of line without line continuation 求解决
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.28 22:27:04