无法发布我的第三个脚本Pine-script外部链接错误

时间:2020-07-17 03:06:39

标签: pine-script

我正在尝试在tradingview中发布我的第3个脚本,但这给了我一个错误,我需要成为具有10个代表的PRO会员才能发布外部链接。我的代码没有外部链接。你能帮忙吗?我的代码如下:

//@version=4
study("Spread Chart", shorttitle="Spread Chart")

//Input
operator = input(title="Operator", defval="/", options=["/", "+", "-", "*", "1/N"])
comparativeTickerId = input("NSE:NIFTY", type=input.symbol, title="Comparative Symbol") 
showMA = input(defval=false, type=input.bool, title="Show Close Moving Average")
lengthMA = input(50, type=input.integer, minval=1, title="Close Moving Average Period")

//Set up
cs_o = security(comparativeTickerId, timeframe.period, open) 
cs_h = security(comparativeTickerId, timeframe.period, high) 
cs_l = security(comparativeTickerId, timeframe.period, low) 
cs_c = security(comparativeTickerId, timeframe.period, close) 

bs_o = security(syminfo.tickerid, timeframe.period, open) 
bs_h = security(syminfo.tickerid, timeframe.period, high) 
bs_l = security(syminfo.tickerid, timeframe.period, low) 
bs_c = security(syminfo.tickerid, timeframe.period, close) 

op_open = (operator == "/" ? bs_o/cs_o : operator == "+" ? bs_o + cs_o : operator == "-" ? bs_o - cs_o : operator == "*" ? bs_o * cs_o : operator == "1/N" ? 1/bs_o : na)
op_high = (operator == "/" ? bs_h/cs_h : operator == "+" ? bs_h + cs_h : operator == "-" ? bs_h - cs_h : operator == "*" ? bs_h * cs_h : operator == "1/N" ? 1/bs_h : na)
op_low = (operator == "/" ? bs_l/cs_l : operator == "+" ? bs_l + cs_l : operator == "-" ? bs_l - cs_l : operator == "*" ? bs_l * cs_l : operator == "1/N" ? 1/bs_l : na)
op_close = (operator == "/" ? bs_c/cs_c : operator == "+" ? bs_c + cs_c : operator == "-" ? bs_c - cs_c : operator == "*" ? bs_c * cs_c : operator == "1/N" ? 1/bs_c : na)


//Plot
plotcandle(op_open, op_high, op_low, op_close, color = op_close > op_open ? color.green : color.red)
plot(showMA ? sma(op_close, lengthMA) : na)

0 个答案:

没有答案