交易视图松码编辑器错误:不匹配的输入'if'期望'end of line without line continuation'



我的代码有什么问题?我问了这个问题,他们的解决方案不工作

`//@version=2
// Define Order-Block parameters
blockSize = 100
minProfit = 0.01
stopLoss = 0.02
// Entry rule
if close > highest(close, blockSize) + minProfit
strategy.entry("Long", strategy.long) 
else if close < lowest(close, blockSize) - minProfit
strategy.entry("Short", strategy.short)
// Exit rule
if strategy.position_size > 0 and close < highest(close, blockSize) * (1 - stopLoss)
strategy.close("Long")
else if strategy.position_size < 0 and close > lowest(close, blockSize) * (1 + stopLoss)
strategy.close("Short")

我问聊天和浏览互联网没有工作我删除了那些':',但它现在是不匹配的输入'if'期望'行结束,没有行延续'

I FOUND SOLUTION TURN VERSION 5

pinescript中的if语句末尾没有:。只要删除这些,不要忘记在你的代码中添加一个strategy()调用。

最新更新