Pine script 将市场工具存储在数组中,这样我就可以循环它们以使代码可重用

Pine script 将市场工具存储在数组中,这样我就可以循环它们以使代码可重用,pine-script,Pine Script,我想做以下工作,但作为一个可重用代码,而不是硬编码,这意味着我必须使用for和一个数组来存储市场工具。我该怎么做 current = f_security(syminfo.tickerid, timeframe.period, close, i_repaint) BTCUSDT = f_security("BINANCE:BTCUSDT", timeframe.period, close, i_repaint) BTCPERP = f_security("BINAN

我想做以下工作,但作为一个可重用代码,而不是硬编码,这意味着我必须使用
for
和一个数组来存储市场工具。我该怎么做

current = f_security(syminfo.tickerid, timeframe.period, close, i_repaint)
BTCUSDT = f_security("BINANCE:BTCUSDT", timeframe.period, close, i_repaint)
BTCPERP = f_security("BINANCE:BTCPERP", timeframe.period, close, i_repaint)

sum = current + BTCUSDT + BTCPERP / 3