From a9eb8ce1bf8bd807e6aebf7c98cd210fcf9acfa7 Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Wed, 16 Feb 2022 05:47:41 -0600 Subject: [PATCH] added todos back in --- freqtrade/freqtradebot.py | 1 + freqtrade/optimize/backtesting.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index c7e9ff19c..55887529b 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -1358,6 +1358,7 @@ class FreqtradeBot(LoggingMixin): trade_base_currency = self.exchange.get_pair_base_currency(pair) wallet_amount = self.wallets.get_free(trade_base_currency) logger.debug(f"{pair} - Wallet: {wallet_amount} - Trade-amount: {amount}") + # TODO-lev: Get wallet amount + value of positions if wallet_amount >= amount or self.trading_mode == TradingMode.FUTURES: # A safe exit amount isn't needed for futures, you can just exit/close the position return amount diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index c24f6e5db..c1dad72d5 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -127,6 +127,8 @@ class Backtesting: self.config['startup_candle_count'] = self.required_startup self.exchange.validate_required_startup_candles(self.required_startup, self.timeframe) + # TODO-lev: This should come from the configuration setting or better a + # TODO-lev: combination of config/strategy "use_shorts"(?) and "can_short" from the exchange self.trading_mode = TradingMode(config.get('trading_mode', 'spot')) self._can_short = self.trading_mode != TradingMode.SPOT