HOW DO I SOLVE THIS ISSUE?
IF I remove the security function I get a new error. mutable variable in a security expression. The security function was done to get rid of it. But now I got new errors
ERRORS: line 31: Cannot call 'security' with 'symbol'=series[string]. The argument should be of type: string; line 33: Undeclared identifier 'bs'; line 34: Undeclared identifier 'crs'
//@version=4
study("CRS 3", shorttitle="CRS 3")
a = syminfo.tickerid
input1 = input("DJI", type=input.symbol)
input2 = input("NIFTY1!", type=input.symbol)
//var string b = na
//if a == "NIFTY1!"
// b := input1
//else
// b := input2
cal_b() =>
var string b = na
if a == "NIFTY1!"
b := input1
else
b := input2
return = b
as = security(a, timeframe.period, close) //LINE 31
bs = security(cal_b(), timeframe.period, close)
crs = as/bs //LINE 33
plot(crs, linewidth=1, color=color.black, title="CRS", display=display.all, transp=0) //LINE 34