Pine Script 中一长串函数值的换行
Line wrapping for a long set of function values in Pine Script
我想换行,因为它太长了,无法在一个屏幕上看到所有内容:
strategy.entry
("Long Continuation",
true, 1, when = FastMA < SlowMA and SlowMA > SlowMA[5] and ShortDiff <
ShortDiff[1]
and close[1] < _PercentAbove and close[1] > _PercentBelow)
它在解包时工作,但当我将它包起来时,我收到错误消息,“添加到图表操作失败,原因:第 15 行:输入语法错误 'end of line without line continuation'
我知道我可以用更好的代码来缩短它,但我只是对 Pine 中的换行工作感到好奇enter code here
如果要换行,下一行必须以一个或多个(不同于 4 的倍数)空格开头。
您的代码似乎有 4 个空格,这会导致错误。
应编译以下代码。
strategy.entry("Long Continuation",
true, 1,
when = FastMA < SlowMA and SlowMA > SlowMA[5] and
ShortDiff < ShortDiff[1] and close[1] < _PercentAbove and
close[1] > _PercentBelow)
分别有0,1,2,3,5个空格
我想换行,因为它太长了,无法在一个屏幕上看到所有内容:
strategy.entry
("Long Continuation",
true, 1, when = FastMA < SlowMA and SlowMA > SlowMA[5] and ShortDiff <
ShortDiff[1]
and close[1] < _PercentAbove and close[1] > _PercentBelow)
它在解包时工作,但当我将它包起来时,我收到错误消息,“添加到图表操作失败,原因:第 15 行:输入语法错误 'end of line without line continuation'
我知道我可以用更好的代码来缩短它,但我只是对 Pine 中的换行工作感到好奇enter code here
如果要换行,下一行必须以一个或多个(不同于 4 的倍数)空格开头。
您的代码似乎有 4 个空格,这会导致错误。
应编译以下代码。
strategy.entry("Long Continuation",
true, 1,
when = FastMA < SlowMA and SlowMA > SlowMA[5] and
ShortDiff < ShortDiff[1] and close[1] < _PercentAbove and
close[1] > _PercentBelow)
分别有0,1,2,3,5个空格