From b53329f2d05b5814e0a14a057d90ddcfc9ae2f93 Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Wed, 18 Dec 2024 10:08:34 +0100 Subject: [PATCH] [Exchanges] handle MAX_FETCHED_OHLCV_COUNT --- Trading/Exchange/okx/okx_exchange.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Trading/Exchange/okx/okx_exchange.py b/Trading/Exchange/okx/okx_exchange.py index 53c720b27..82da6011a 100644 --- a/Trading/Exchange/okx/okx_exchange.py +++ b/Trading/Exchange/okx/okx_exchange.py @@ -112,6 +112,10 @@ class Okx(exchanges.RestExchange): DEFAULT_CONNECTOR_CLASS = OkxConnector MAX_PAGINATION_LIMIT: int = 100 # value from https://www.okex.com/docs/en/#spot-orders_pending + # set when the exchange returns nothing when fetching historical candles with a too early start time + # (will iterate historical OHLCV requests over this window) + MAX_FETCHED_OHLCV_COUNT = 100 + # Okx default take profits are market orders # note: use BUY_MARKET and SELL_MARKET since in reality those are conditional market orders, which behave the same # way as limit order but with higher fees