python-bitget
python-bitget copied to clipboard
Missing "Get History Candle Data"
Hi,
Thank you very much for your great work. I have noticed that the "Get History Candle Data" is missing in your Code (https://bitgetlimited.github.io/apidoc/en/mix/#get-history-candle-data). The "Get Candle Data" is included but this is only limited to 30 days of history by Bitget.
Kind regards, Chris
Hi Chris
You can just add the following to client.py. I have been working to amend client.py to use V2 API.
def mix_get_historycandles(self, symbol, granularity, startTime, endTime, limit=100):
"""
Get Candle Data: https://bitgetlimited.github.io/apidoc/en/mix/#get-candle-data
Limit rule: 20 times/1s (IP)
Required: symbol, granularity, startTime, endTime
:return:
"""
params = {}
if symbol and granularity and startTime and endTime:
params["symbol"] = symbol
params["granularity"] = granularity
params["startTime"] = startTime
params["endTime"] = endTime
params["limit"] = limit
return self._request_with_params(GET, MIX_MARKET_V1_URL + '/history-candles', params)
else:
logger.error("pls check args")
return False
Thanks