Skip to main content

security

Syntax Format​

security(ticker_id, resolution)

Overview​

The security function retrieves data for the financial security based on the specified ticker ID and resolution. This function can be useful when analyzing the data of several trading securities or different resolution timeframes.

Parameters​

ParameterTypePurpose
ticker_idintegerThe ID of the ticker. It can be retrieved using the get_ticker_id function. current_ticker_id is a special value that returns the ID of the current asset (the asset your indicator is running on)
resolutionstringThe timeframe resolution for the returned security

Returns: a table with series.

The possible values of the returned series are:

{
close,
open,
high,
low,
volume,
open_time,
close_time
}

Example​

security_data = security(current_ticker_id, "5s")

plot(security_data.close)