Skip to Content
API Referencesecurity (other security)

security (other security)

security(exchange: String, symbol: String, timeframe: Timeframe) -> Array<Kline>

Retrieve a different security’s data, possibly from another exchange. The data is then mapped to the current kline data, so that it can be used immediately in the strategy without requiring further modification.

Note

Data is retrieved every time this function is called, as such it is not recommended to rely on this function if low latency is desired.

Note

If this function is used, the strategy will no longer work with the optimizer.

Example:

-- imagine this strategy is run on binance:BTC/USDT, on the 15m timeframe local klines_oneday = security("binance", "BTC/USDT", "1d") -- do something with the data local result = gt(close, klines_oneday.close)