简体   繁体   English

输入不匹配'...'期望'行尾没有续行'

[英]Mismatched input '...' Expecting 'end of line without line continuation'

I get the error message on line 15: "Mismatched input 'strategy.entry' Expecting 'end of line without line continuation'.我在第 15 行收到错误消息:“不匹配的输入'strategy.entry'期望'行尾没有行继续'。

Code:代码:

//@version=5

fastL=12
slowL=26
macdL=9

MACD=ta.ema(close,fastL)-ta.ema(close,slowL)
signal=ta.ema(MACD,macdL)

plot(MACD, title="MACD_line",color=color.blue)
plot(signal,title="signal_line",color=color.orange)

If (MACD[1]<0 and MACD>MACD[1])
    strategy.entry("strategy.Long",strategy.long)
If (MACD[1]>0 and MACD<MACD[1])
    strategy.entry("strategy.Short",strategy.Short)

Thank you for any help.感谢您的任何帮助。

  1. You have to use if instead of If你必须使用 if 而不是 If
  2. You have to use strategy.long/strategy.short instead of strategy.Long/strategy.Short您必须使用 strategy.long/strategy.short 而不是 strategy.Long/strategy.Short

Code代码

//@version=5
strategy("Test")
fastL=12
slowL=26
macdL=9
MACD=ta.ema(close,fastL)-ta.ema(close,slowL)
signal=ta.ema(MACD,macdL)
plot(MACD, title="MACD_line",color=color.blue) 
plot(signal,title="signal_line",color=color.orange)
if (MACD[1]<0 and MACD>MACD[1]) 
    strategy.entry("strategy.long",strategy.long)
if (MACD[1]>0 and MACD<MACD[1]) 
    strategy.entry("strategy.short",strategy.short)

暂无
暂无

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

相关问题 不匹配的输入“没有行延续的行尾”期望“_” - Mismatched input 'end of line without line continuation' expecting '_' Pine 脚本输入不匹配,期待“行尾没有续行” - Pine Script mismatched input, expecting 'end of line without line continuation' 不匹配的输入“如果”期望“没有行继续的行尾” - mismatched input 'if' expecting 'end of line without line continuation' 不匹配的输入“情节”期望“没有行继续的行尾” - Mismatched input 'plot' expecting 'end of line without line continuation' PINESCRIPT 错误:不匹配的输入“=”期望“没有行继续的行尾” - PINESCRIPT ERROR: mismatched input '=' expecting 'end of line without line continuation' 不匹配的输入“到”期望“行尾没有续行” - Mismatched input 'to' expecting 'end of line without line continuation' 不匹配的输入“=”期望“行尾没有续行”(PS5) - Mismatched input '=' expecting 'end of line without line continuation' (PS5) 错误 If Else Mismatched input 'if' expecting 'end of line without line continuation' - Error If Else Mismatched input 'if' expecting 'end of line without line continuation' 我不能运行这个,第 39 行:不匹配的输入 &#39;stopLossLongSaved&#39; 期望 &#39;行尾没有续行 - I cant run this, line 39: Mismatched input 'stopLossLongSaved' expecting 'end of line without line continuation 第 11 行:不匹配的输入“stopValue”期望“行尾没有续行” - line 11: Mismatched input 'stopValue' expecting 'end of line without line continuation'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM