I am trying to read symbols (strings) from an array, but array.get
returns a series[string] object, while security
only accepts simple strings. I tried casting to string, but it still gives a "series[string] argument is not accepted" error. Is there a way to make this work?
//@version=4
study("etfa", shorttitle = 'etfa', max_bars_back=500, overlay = false)
length=input(40, title="length", type=input.integer)
sFunc(length) =>
kkl=stoch(close,high,low,length)
kkl
aaa=array.new_float(0,0)
aa=array.new_string(4, "text")
array.set(aa,0,"AAPL")
array.set(aa,1,"MSFT")
array.set(aa,2,"AMZN")
array.set(aa,3,"GOOGL")
for i = 0 to 3
k=array.get(aa,i)
r=string(k)
rr=security(r, timeframe.period,sFunc(length))
array.push(aaa,rr)