Skip to content

helper_funcs

Classes

Functions

candles_to_df

candles_to_df(candles)

Converts your numpy array candles to a pandas dataframe

Parameters:

Name Type Description Default
candles ndarray

a 2 dim array with the following columns "timestamp", "open", "high", "low", "close", "volume"

required

Returns:

Type Description
DataFrame

columns "timestamp", "open", "high", "low", "close", "volume" with an index of pandas datetimes

dl_ex_candles

dl_ex_candles(exchange, symbol, timeframe, candles_to_dl=None, since_datetime=None, until_datetime=None)

Download candles from the exchange of your choice

Parameters:

Name Type Description Default
exchange str

binance futures = 'binance_usdm' | default candles to dl is 1500

mufex = 'mufex' | default candles to dl is 1500

bybit = 'bybit' | default candles to dl is 1000

required
symbol str

Check the api of the exchange or get all the symbols of the exchange to see which ones you need to put here

required
timeframe str
"1m", "5m", "15m", "30m", "1h", "2h", "4h", "6h", "12h", "d", "w"
required
since_datetime datetime

The start date, in datetime format, of candles you want to download. EX: datetime(year, month, day, hour, minute)

None
until_datetime datetime

The until date, in datetime format, of candles you want to download minus one candle so if you are on the 5 min if you say your until date is 1200 your last candle will be 1155. EX: datetime(year, month, day, hour, minute)

None
candles_to_dl int

The amount of candles you want to download

None

Returns:

Type Description
array

a 2 dim array with the following columns "timestamp", "open", "high", "low", "close", "volume"