Reputation: 21
I want to include in the indicator code the closing prices of several different stocks in a comparison, but I don't know how to refer to the closing prices of these other stocks. what function would allow me to do that?
Upvotes: 2
Views: 4520
Reputation: 115
The function you are looking for is called security
. Here is the reference.
For an example:
If you want to retrieve the close price of BTC/USD
on biance
you use the security
function like
btc_close = nz(security("binance:BTCUSDT", timeframe.period, close))
The function nz
replaces NaN values with zeros.
Upvotes: 5