简体   繁体   English

在Pine Script中使用换行来获取一长串函数值

[英]Line wrapping for a long set of function values in Pine Script

I'm trying to wrap this line, as it is too long to see all on one screen: 我正在尝试换行,因为在一个屏幕上看不到所有内容太长了:

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)

It works unwrapped, but when I wrap it, I get the error, "Add to Chart operation failed, reason: line 15: syntax error at input 'end of line without line continuation' 它可以解包,但是当我包装它时,出现错误,“添加到图表操作失败,原因:第15行:输入'行尾没有行连续的语法错误”

I realize I can shorten this with better code, but I'm just curious about line wrapping works in Pine enter code here 我意识到我可以使用更好的代码来缩短它,但是我只是对Pine中的换行功能感到好奇,请在enter code here

If you want to wrap lines, next line must begin with one or several ( different from multiple of 4 ) spaces. 如果要换行,下一行必须以一个或几个( 不同于4的倍数 )空格开头。

Your code seems to have 4 spaces, which causes the error. 您的代码似乎有4个空格,这会导致错误。

The following code should compile. 以下代码应编译。

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)

It has 0, 1, 2, 3, 5 spaces, respectively. 它分别具有0、1、2、3、5个空格。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM