File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -65,15 +65,22 @@ def ohlcv_candle_limit(
6565 """
6666 Exchange ohlcv candle limit
6767 OKX has the following behaviour:
68- * 300 candles for up-to-date data
69- * 100 candles for historic data
70- * 100 candles for additional candles (not futures or spot).
68+ * spot and futures:
69+ * 300 candles for regular candles
70+ * mark and premium-index:
71+ * 300 candles for up-to-date data
72+ * 100 candles for historic data
73+ * additional data:
74+ * 100 candles for additional candles
7175 :param timeframe: Timeframe to check
7276 :param candle_type: Candle-type
7377 :param since_ms: Starting timestamp
7478 :return: Candle limit as integer
7579 """
76- if candle_type in (CandleType .FUTURES , CandleType .SPOT ) and (
80+ if candle_type in (CandleType .FUTURES , CandleType .SPOT ):
81+ return 300
82+
83+ if candle_type in (CandleType .MARK , CandleType .PREMIUMINDEX ) and (
7784 not since_ms or since_ms > (date_minus_candles (timeframe , 300 ).timestamp () * 1000 )
7885 ):
7986 return 300
You can’t perform that action at this time.
0 commit comments