sammchardy / python-binance

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

Сan't download the history for 1s klines #1309

Closed akoziy98 closed 1 year ago

akoziy98 commented 1 year ago

In current version, it's impossible to download 1s historical klines using get_historical_klines

It can be simply fixed by add "s" key to function interval_to_milliseconds in helpers.py

seconds_per_unit: Dict[str, int] = {
        "s" : 1,
        "m": 60,
        "h": 60 * 60,
        "d": 24 * 60 * 60,
        "w": 7 * 24 * 60 * 60,
    }
akoziy98 commented 1 year ago

Thanks a lot!

GredAlex commented 6 months ago

now you can specify something like the string = client.get_historical_lines("BTCFDUSD", Client.KLINE_INTERVAL_1 second "December 1, 2023", "January 1, 2024") and I will get the historical lines of the specified interval?