You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an issue fetching historical data with the bingx API, I can only fetch one single candle, I try different approach and methods but always the same output, somebody knows how to fix this issue?
Script:
`def fetch_all_timeframes_data(exchange, symbol, timeframes, limit=100, market_type='futures'):
data_dict = {}
for timeframe in timeframes:
try:
data = exchange.fetch_ohlcv(symbol, timeframe, limit=limit, params={'type': market_type})
data_dict[timeframe] = data
print(f"Fetched {len(data)} candles for timeframe: {timeframe}")
for row in data:
timestamp = datetime.fromtimestamp(row[0] / 1000).strftime('%Y-%m-%d %H:%M:%S')
print(f"{timestamp}: {row}")
time.sleep(2)
except Exception as e:
print(f"Error fetching data for timeframe {timeframe}: {e}")
return data_dict`
Hi!
Are you using the correct endpoint? "GET /openApi/swap/v3/quote/klines"
You can also check out my implementation here: https://github.com/amirinsight/py-bingx
Hello everybody,
I have an issue fetching historical data with the bingx API, I can only fetch one single candle, I try different approach and methods but always the same output, somebody knows how to fix this issue?
Script:
Log:
Fetched 1 candles for timeframe: 1m
2023-09-30 11:56:00: [1696067760000, 57.1, 57.1, 56.973, 56.973, 283.88]
Fetched 1 candles for timeframe: 5m
2023-09-30 11:55:00: [1696067700000, 57.137, 57.184, 56.973, 56.997, 1441.26]
Fetched 1 candles for timeframe: 15m
2023-09-30 11:45:00: [1696067100000, 57.219, 57.428, 56.815, 57.009, 29509.82]
Fetched 1 candles for timeframe: 30m
2023-09-30 11:30:00: [1696066200000, 57.352, 57.468, 56.719, 57.026, 84049.6]
The text was updated successfully, but these errors were encountered: