CryptoExcel

Crypto Excel » Docs_functions Fetch Convert History

Function Convert History

Convert multiple coins to another coin/fiat for a specific Time Frame and period using historical data from a specific exchange 

function-convert-history
Function Convert History
Convert History
Convert History

1. Syntax

=ST_OHLCV( from_coin, to_coin, TF, since_tf, to_tf, [exchange][limit_tf], [sec], [val_100], [reverse])

2. Parameters

 

ParameterRequiredDescriptionExample
from_coinYCoin you want to convert. Can be a range ( multiple coins)“BTC”, “ETH”
to_coinYCoin/fiat “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
exchangeN Default BinanceExchange you want to use for the conversion“bitmex”
limit_tf**N Default 100Max numbers of bars for each request500
secN Default 2Sec between consecutive request1.5
val_100***N Default 0 Show historical value of 100 to_coin 
reverseN Default 10/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

*** in the figure 100 USDT of BTC at the end of the period are worth 140 USDT. 100 USDT of LTC at the end of the period are worth 80 USDT

from_coin

Required: Y

Description: Coin you want to convert. Can be a range ( multiple coins)

Example: “BTC”

to_coin

Required: Y

Description: coin/fiat

Example: “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

Exchange

Required: N. default binance

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

Example: “bitmex”

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

Val_100

Required: N default 1

Description: Show historical value of 100 to_coin

Example: 0

in the figure 100 USDT of BTC at the end of the period are worth 140 USDT. 100 USDT of LTC at the end of the period are worth 80 USDT

Reverse

Required: N default 1

Description: Time order

Example: 1

3. Return Value

ValueDescription
TimeLocal time TF started
from_coin/to_coin…..Conversion rate
100_from_coint/to_coin

historical value of 100 to_coin

Time

Local time TF started

from_coin/to_coin.....

Conversion rate

100_from_coint/to_coin

historical value of 100 to_coin

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 Convert History function converts multiple coins to another coin/fiat for a specific Time Frame and period using historical data from a specific exchange. When the val_100 option is on (default) different equity lines for buying 100 worth of to_coin are shown.
In the figure 100 USDT of BTC at the end of the period are worth 140 USDT. 100 USDT of LTC at the end of the period are worth 80 USDT

Use this function for portfolio tracking and correlation analysis.

This function does not require Authentication

6. Convert History related functions