mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
feat: adjust okx ohlcv candle limits
This commit is contained in:
@@ -65,15 +65,22 @@ class Okx(Exchange):
|
|||||||
"""
|
"""
|
||||||
Exchange ohlcv candle limit
|
Exchange ohlcv candle limit
|
||||||
OKX has the following behaviour:
|
OKX has the following behaviour:
|
||||||
* 300 candles for up-to-date data
|
* spot and futures:
|
||||||
* 100 candles for historic data
|
* 300 candles for regular candles
|
||||||
* 100 candles for additional candles (not futures or spot).
|
* mark and premium-index:
|
||||||
|
* 300 candles for up-to-date data
|
||||||
|
* 100 candles for historic data
|
||||||
|
* additional data:
|
||||||
|
* 100 candles for additional candles
|
||||||
:param timeframe: Timeframe to check
|
:param timeframe: Timeframe to check
|
||||||
:param candle_type: Candle-type
|
:param candle_type: Candle-type
|
||||||
:param since_ms: Starting timestamp
|
:param since_ms: Starting timestamp
|
||||||
:return: Candle limit as integer
|
:return: Candle limit as integer
|
||||||
"""
|
"""
|
||||||
if candle_type in (CandleType.FUTURES, CandleType.SPOT) and (
|
if candle_type in (CandleType.FUTURES, CandleType.SPOT):
|
||||||
|
return 300
|
||||||
|
|
||||||
|
if candle_type in (CandleType.MARK, CandleType.PREMIUMINDEX) and (
|
||||||
not since_ms or since_ms > (date_minus_candles(timeframe, 300).timestamp() * 1000)
|
not since_ms or since_ms > (date_minus_candles(timeframe, 300).timestamp() * 1000)
|
||||||
):
|
):
|
||||||
return 300
|
return 300
|
||||||
|
|||||||
Reference in New Issue
Block a user