sammchardy / python-binance

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

Add endpoint for futures klines stream #941

Open MarCorCon opened 3 years ago

MarCorCon commented 3 years ago

Description

Add an endpoint for getting the futures klines stream.

The endpoint should receive klines for both USD-M or COIN-M futures.

The endpoint should receive as parameter the kind of contract (Perpetual, next quarter, current quarter)

MarCorCon commented 3 years ago

I created a pull request with the endpoint described in the issue.

halfelf commented 3 years ago

@MarCorCon I have found that kline_futures_socket's path format has a small problem.

path = f'{symbol.lower()}_{contract_type}@continuousKline_{interval}'

should be

path = f'{symbol.lower()}_{contract_type.value}@continuousKline_{interval}'