I'm trying to make some sort of correlation by power study. The plan is to draw all elements of an industry, average and SPX. The industry is chosen depending on which ticker you are looking at.
I run into the problem that I can't use members of an array to call security(). I'm looking for any workaround or solution:
banks = array.new_string(0)
array.push(banks, "BAC")
array.push(banks, "JPM")
array.push(banks, "C")
array.push(banks, "WFC")
rocPeriod = input(30, minval = 1)
perc_change = roc(close, rocPeriod)
for i = 0 to array.size(result)
var sec = security(array.get(result, i), res, perc_change)
This code doesn't work because security() expects string, but arrays get() return series[string] by some reason.
Any ideas?
Thanks