有人请检查我得到的错误

时间:2019-02-25 10:11:16

标签: pine-script

请检查以下代码。将其添加到图表时出现语法错误。它说13时语法错误

//@version=3
strategy("My Strategy", overlay=true)
len = input(14, minval=1, title="DI Length")
lensig = input(14, title="ADX Smoothing", minval=1, maxval=50)

up = change(high)
down = -change(low)
DIPLUS = na(up) ? na : (up > down and up > 0 ? up : 0)
DIMinus = na(down) ? na : (down > up and down > 0 ? down : 0)
trur = rma(tr, len)
plus = fixnan(100 * rma(DIPLUS, len) / trur)
minus = fixnan(100 * rma(DIMinus, len) / trur)
sum = plus + minus
ADX = 100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), lensig)

//[MACD, MACDSignal, histLine] = macd(close, 12, 26, 9)


longCondition = close, 13 > vwap and crossover(ADX, DIMinus) //and 
crossover(MACD, MACDSignal)

if (longCondition)
strategy.entry("My Long Entry Id", strategy.long)

//shortCondition = crossunder(ema(close, 13), vwap) and crossover(ADX, 
DIPLUS) 
//and crossover(MACDSignal, MACD)
//if (shortCondition)
//strategy.entry("My Short Entry Id", strategy.short)

0 个答案:

没有答案