sammchardy / python-binance

Binance Exchange API python implementation for automated trading
https://python-binance.readthedocs.io/en/latest/
MIT License
6.09k stars 2.21k forks source link

In the get_historical_klines for interval argument less than 1m #593

Open keerthankumar opened 4 years ago

keerthankumar commented 4 years ago

is there any roadmap or plan to implement the interval with seconds like 1 sec, 15 sec, etc? in the current implementation lowest is 1m.

TheCaesar13 commented 4 years ago

When you call "get_historical_klines" you access the data made available by Binance. Since on the markets view from binance.com the lowest time interval is 1min, it means there is no way to implement a lower time interval because the data is not available.

Wyctus commented 4 years ago

An alternative solution is to listen on the live trades socket and aggregate them into klines for any time interval you like.

ShayanFiroozi commented 3 years ago

It's possible but not too easy ,

You should start an webclient on wss://stream.binance.com:9443/ws/btcusdt@kline_1m and the binance will send you a kline each 2 seconds , you should convert the kline to a candlestick and save to a list , so you have a list of candle sticks for each 2 seconds.

Then use numpy and pandas to resample your candles list to 15S or any time frame you want ;) Good Luck

DutuIulian commented 2 years ago

Hello! Now, you can see 1 second candlesticks for coins on Binance. Is there any update on this issue?