From f290ff5c9aa68c06fc162a463097fc34b1fd8594 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 12 Oct 2021 19:10:38 +0200 Subject: [PATCH 1/2] Re-add schedule.run_pending --- freqtrade/freqtradebot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 88b26115e..ddb4b148f 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -203,7 +203,8 @@ class FreqtradeBot(LoggingMixin): # Then looking for buy opportunities if self.get_free_open_trades(): self.enter_positions() - + if self.trading_mode == TradingMode.FUTURES: + self._schedule.run_pending() Trade.commit() def process_stopped(self) -> None: From 532a9341d2506a00a6c7d617fec443670a8fdadb Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 12 Oct 2021 20:41:48 +0200 Subject: [PATCH 2/2] Fix migration issue --- freqtrade/exchange/exchange.py | 3 +++ freqtrade/persistence/migrations.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 315ab62c5..ca546eef4 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -71,6 +71,9 @@ class Exchange: "l2_limit_range_required": True, # Allow Empty L2 limit (kucoin) } _ft_has: Dict = {} + + # funding_fee_times is currently unused, but should ideally be used to properly + # schedule refresh times funding_fee_times: List[int] = [] # hours of the day _supported_trading_mode_collateral_pairs: List[Tuple[TradingMode, Collateral]] = [ diff --git a/freqtrade/persistence/migrations.py b/freqtrade/persistence/migrations.py index ec6f10e3f..2b1d10bc1 100644 --- a/freqtrade/persistence/migrations.py +++ b/freqtrade/persistence/migrations.py @@ -180,7 +180,7 @@ def check_migrate(engine, decl_base, previous_tables) -> None: table_back_name = get_backup_name(tabs, 'trades_bak') # Check for latest column - if not has_column(cols, 'is_short'): + if not has_column(cols, 'funding_fees'): logger.info(f'Running database migration for trades - backup: {table_back_name}') migrate_trades_table(decl_base, inspector, engine, table_back_name, cols) # Reread columns - the above recreated the table!