mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-16 04:41:15 +00:00
Call connection at intervals
This commit is contained in:
@@ -563,6 +563,13 @@ class Exchange:
|
|||||||
amount, self.get_precision_amount(pair), self.precisionMode, contract_size
|
amount, self.get_precision_amount(pair), self.precisionMode, contract_size
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def ws_connection_reset(self):
|
||||||
|
"""
|
||||||
|
called at regular intervals to reset the websocket connection
|
||||||
|
"""
|
||||||
|
if self._exchange_ws:
|
||||||
|
self._exchange_ws.reset_connections()
|
||||||
|
|
||||||
def _load_async_markets(self, reload: bool = False) -> None:
|
def _load_async_markets(self, reload: bool = False) -> None:
|
||||||
try:
|
try:
|
||||||
if self._api_async:
|
if self._api_async:
|
||||||
|
|||||||
@@ -168,6 +168,8 @@ class FreqtradeBot(LoggingMixin):
|
|||||||
t = str(time(time_slot, minutes, 2))
|
t = str(time(time_slot, minutes, 2))
|
||||||
self._schedule.every().day.at(t).do(update)
|
self._schedule.every().day.at(t).do(update)
|
||||||
|
|
||||||
|
self._schedule.every().day.at("00:02").do(self.exchange.ws_connection_reset)
|
||||||
|
|
||||||
self.strategy.ft_bot_start()
|
self.strategy.ft_bot_start()
|
||||||
# Initialize protections AFTER bot start - otherwise parameters are not loaded.
|
# Initialize protections AFTER bot start - otherwise parameters are not loaded.
|
||||||
self.protections = ProtectionManager(self.config, self.strategy.protections)
|
self.protections = ProtectionManager(self.config, self.strategy.protections)
|
||||||
@@ -289,7 +291,6 @@ class FreqtradeBot(LoggingMixin):
|
|||||||
# Then looking for entry opportunities
|
# Then looking for entry opportunities
|
||||||
if self.get_free_open_trades():
|
if self.get_free_open_trades():
|
||||||
self.enter_positions()
|
self.enter_positions()
|
||||||
if self.trading_mode == TradingMode.FUTURES:
|
|
||||||
self._schedule.run_pending()
|
self._schedule.run_pending()
|
||||||
Trade.commit()
|
Trade.commit()
|
||||||
self.rpc.process_msg_queue(self.dataprovider._msg_queue)
|
self.rpc.process_msg_queue(self.dataprovider._msg_queue)
|
||||||
|
|||||||
Reference in New Issue
Block a user