【发布时间】:2021-04-15 00:58:08
【问题描述】:
我是 Pine 的新手,如果要处理选择输入,则无法获得以下内容
// Backtest
entrySource = input(title="Enter On", defval = "Buy Big Green", options=["Buy Small Green", "Buy Big Green", "Buy Big Green Div"])
exitSource = input(title="Exit On", defval = "Sell Big Red", options=["Sell Small Red", "Sell Big Red", "Sell Big Red Div"])
entry = if entrySource == "Buy Small Green"
wtCross and wtCrossUp
else if entrySource == "Buy Big Green"
entry = buySignal
else if entrySource == "Sell Small Red"
entry = buySignalDiv
else
na
exit = if exitSource == "Buy Small Green"
wtCross and wtCrossDown
else if entrySource == "Sell Big Red"
buySignal
else if entrySource == "Sell Small Red"
buySignalDiv
else
na
我得到了经典的 line 489: Mismatched input 'wtCross' expecting 'end of line without line continuation'. 错误,但我不知道为什么。
【问题讨论】:
标签: if-statement pine-script trading