CryptoExcel

Crypto Excel » Docs_functions Fetch OHLCV

Function OHLCV

Fetch OHLCV Open, High, Low, Close, Volume (OHLCV/candels) from a selected exchange, trading pair, time frame and dates into Excel.

Function-OHLCV
Function OHLCV

1. Syntax

=ST_OHLCV( exchange, symbol, TF, since_tf, to_tf, [limit_tf], [sec], [reverse])

2. Parameters

 

ParameterRequiredDescriptionExample
ExchangeYExchange name (e.g., binance, coinbase, kraken, my_exc)“binance”
SymbolYTrading pair“ATOM/USDT”
TF*YTime frame1m, 1d
since_tfYStarting date mm/dd/yy hh:mm10/15/24 20:00
to_tfYEnd date mm/dd/yy hh:mm. can be now10/15/24 22:00/now
limit_tf**N Default 100Max numbers of bars for each request500
secN Default 2Sec between consecutive request1.5
reverseN Default 00/1 Time order 

*Every exchange supports different time frame, Use st_ohlcv_tf(exchange) to know which tf are supported.
** There is a limit to the number of bars you can obtain for each request. you can change the default value but you need to read the Exchange’s docs to get the max number allowed

Exchange

Required: Y

Description: Exchange name (e.g., binance, coinbase, kraken)

Example: “binance”

Symbol

Required: Y

Description: Trading pair

Example: “BTC/USDT”

TF

Required: Y

Description: Time Frame

Example: 1m, 1d

Every exchange supports different time frame, Use st_ohlcv_tf(exchange) to know which tf are supported.

since_tf

Required: N

Descriptionstarting date mm/dd/yy hh:mm

Example: 10/15/24 20:00

to_tf

Required: N

Description:  End date mm/dd/yy hh:mm. can be now

Example: 10/15/24 23:52

Use Now if you want to get te time series ending to the last available tf

Limit_tf

Required: N default 100

Description: Max numbers of bars for each request

Example: 500

Sec

Required: N default 2

Description: Sec between consecutive request

Example: 2.5

Reverse

Required: N default 0

Description: Time order

Example: 1

3. Return Value

ValueDescription
TimeLocal time TF started
OpenOpen TF price
HighHighest TF price
LowLowest TF price
CloseClose TF price
VolVolume 

 

Time

Local time TF started

Open

Open TF Price

High

Highest TF price

Low

Lowest TF price

Close

Close TF price

Vol

Volume

4. Rate limits

This function send multiple requests to the exchange to fetch all the bars you need. It consumes your rate limit. Fine tune your requests using limit_tf and sec

Tip. Use st_watch_requests() to monitor your requests.

5. Usage

The OHLCV function returns Date, Open. high, Low, Close, Volume ( also called bars or candels) for a specific period and time frame Historical OHLCV is the base for backtesting. This function does not require Authentication

6. OHLCV related functions