python-binance icon indicating copy to clipboard operation
python-binance copied to clipboard

get_historical_klines, futures

Open localcreator opened this issue 2 years ago • 3 comments

how get_historical_klines for futures? I tried to do client=Client(apiKey,apiSec) candles = client.get_historical_klines('BNBUSDT', Client.KLINE_INTERVAL_2HOUR, "10 day ago UTC",klines_type=HistoricalKlinesType.FUTURES) but it doesn't work.

localcreator avatar Jun 14 '22 13:06 localcreator

bump, I have the same problem

tom634 avatar Jun 16 '22 13:06 tom634

Declare client = Client(api_key= api_key, api_secret= secret_key, tld= "com") Then run client.futures_klines(symbol="XRPBUSD", interval="5m", start_str = "30 minutes ago UTC").

However, there's a problem with futures_klines(**params) and that is the fact that it DOES NOT understand the start date string in UTC format, when it should just as get_historical_klines(**params) does

noahverner1995 avatar Aug 02 '22 05:08 noahverner1995

Declare client = Client(api_key= api_key, api_secret= secret_key, tld= "com") Then run client.futures_klines(symbol="XRPBUSD", interval="5m", start_str = "30 minutes ago UTC").

However, there's a problem with futures_klines(**params) and that is the fact that it DOES NOT understand the start date string in UTC format, when it should just as get_historical_klines(**params) does

Actually, I just realized that the right method to use in my case is futures_historical_klines(**params), so it should be run client.futures_historical_klines(symbol="XRPBUSD", interval="5m", start_str= "30 minutes ago UTC") instead.

The sentence above will return the corresponding OHLC prices of the last 6 5m candlesticks of the symbol "XRPBUSD" from Binance futures market

noahverner1995 avatar Aug 02 '22 05:08 noahverner1995