Skip to content

Commit 73afb9f

Browse files
authored
Merge pull request #1528 from Drakkar-Software/dev
Master update
2 parents 9b7d319 + ad897d8 commit 73afb9f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Trading/Exchange/hollaex/hollaex_exchange.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import typing
1818

1919
import octobot_commons.enums as commons_enums
20+
import octobot_commons.constants as commons_constants
2021
import octobot_trading.enums as trading_enums
2122
import octobot_trading.exchanges as exchanges
2223
import octobot_trading.exchanges.connectors.ccxt.enums as ccxt_enums
@@ -150,6 +151,12 @@ async def get_symbol_prices(self, symbol, time_frame, limit: int = None, **kwarg
150151
# ohlcv without limit is not supported, replaced by a default max limit
151152
if limit is None:
152153
limit = self.DEFAULT_MAX_LIMIT
154+
if "since" not in kwargs:
155+
# temporary fix to prevent hollaex from fetching outdates candles
156+
# remove once hollaex ccxt fetch_ohlcv stop hard coding defaultSpan = 2592000 # 30 days
157+
tf_seconds = commons_enums.TimeFramesMinutes[time_frame] * commons_constants.MINUTE_TO_SECONDS
158+
kwargs["since"] = (self.get_exchange_current_time() - tf_seconds * limit) \
159+
* commons_constants.MSECONDS_TO_SECONDS
153160
return await super().get_symbol_prices(symbol, time_frame, limit=limit, **kwargs)
154161

155162
async def get_closed_orders(self, symbol: str = None, since: int = None,

0 commit comments

Comments
 (0)