vectorbt
vectorbt copied to clipboard
vbt.BinanceData.download do not accept klines_type parameter
Hi,
i am trying to download binance future klines, but i get the error TypeError: download_symbol() got an unexpected keyword argument 'klines_type' https://github.com/sammchardy/python-binance/blob/8cac5eac94b71af6532aef128a8c815d7fc0c617/binance/client.py#L870
from binance.enums import HistoricalKlinesType
symbols = ["BTCUSDT"]
startDate = "2020-12-01"
endtDate = "now UTC"
timeInterval = "1h"
binance_data = vbt.BinanceData.download(
symbols=symbols,
start=startDate,
# end=endtDate,
interval=timeInterval,
klines_type = HistoricalKlinesType.FUTURES
)
binance_data = binance_data.update()
binance_data.get()
Arguments to the client can be provided using client_kwargs
.
Edit: I now see that it's passed not to the client but to the method. I need to add support for it.
TypeError: download_symbol() got an unexpected keyword argument 'client_kwargs klines_type it hink it's not a client argument but a get_klines methode argument
client_kwargs is in fetch, not fetch_symbol. Don't use fetch_symbol, it's mostly for internal use.
client_kwargs
i don't use fetch symbole. i am using download
from binance.enums import HistoricalKlinesType
symbols = ["BTCUSDT"]
startDate = "2022-03-01"
endtDate = "now UTC"
timeInterval = "1h"
binance_data = vbt.BinanceData.download(
symbols=symbols,
start=startDate,
# end=endtDate,
interval=timeInterval,
# client_kwargs=dict(klines_type = HistoricalKlinesType.FUTURES)
)
binance_data = binance_data.update()
binance_data.get()
As said, you can't pass klines_type just yet, I need to manually enable it.
As said, you can't pass klines_type just yet, I need to manually enable it.
ok thanks, as workaround i will use cctx binance data:
symbols = ["BTCUSDT"]
startDate = "2022-03-01"
endtDate = "now UTC"
timeInterval = "1h"
ccxt_data = vbt.CCXTData.download(
symbols,
start='2 hours ago UTC',
end='now UTC',
timeframe=timeInterval,
config = {
'defaultType': 'future'}
)
ccxt_data.get()
@polakowo Any update on allowing us to pass klines_type
?
klines_type is not required. you can pass exchange='binanceusdm' to get the futures prices. list of supported exchanges can be taken from ccxt.exchanges