diff --git a/freqtrade/exchange/bybit.py b/freqtrade/exchange/bybit.py index a1cd40ac6..32bb0e284 100644 --- a/freqtrade/exchange/bybit.py +++ b/freqtrade/exchange/bybit.py @@ -26,7 +26,6 @@ class Bybit(Exchange): _supported_trading_mode_collateral_pairs: List[Tuple[TradingMode, Collateral]] = [ # TradingMode.SPOT always supported and not required in this list - # TODO-lev: Uncomment once supported # (TradingMode.FUTURES, Collateral.CROSS), # (TradingMode.FUTURES, Collateral.ISOLATED) ] diff --git a/freqtrade/exchange/ftx.py b/freqtrade/exchange/ftx.py index 36a08239d..1dbfcdcb1 100644 --- a/freqtrade/exchange/ftx.py +++ b/freqtrade/exchange/ftx.py @@ -27,7 +27,6 @@ class Ftx(Exchange): _supported_trading_mode_collateral_pairs: List[Tuple[TradingMode, Collateral]] = [ # TradingMode.SPOT always supported and not required in this list - # TODO-lev: Uncomment once supported # (TradingMode.MARGIN, Collateral.CROSS), # (TradingMode.FUTURES, Collateral.CROSS) ] diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 599cf6b4d..e714ddc33 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -68,7 +68,6 @@ class FreqtradeBot(LoggingMixin): init_db(self.config.get('db_url', None), clean_open_orders=self.config['dry_run']) - # TODO-lev: Do anything with this? self.wallets = Wallets(self.config, self.exchange) PairLocks.timeframe = self.config['timeframe'] @@ -1133,7 +1132,6 @@ class FreqtradeBot(LoggingMixin): Buy cancel - cancel order :return: True if order was fully cancelled """ - # TODO-lev: Pay back borrowed/interest and transfer back on leveraged trades was_trade_fully_canceled = False # Cancelled orders may have the status of 'canceled' or 'closed' @@ -1272,7 +1270,7 @@ class FreqtradeBot(LoggingMixin): *, exit_tag: Optional[str] = None, ordertype: Optional[str] = None, - ) -> bool: + ) -> bool: """ Executes a trade exit for the given trade and limit :param trade: Trade instance diff --git a/tests/optimize/test_hyperopt.py b/tests/optimize/test_hyperopt.py index d3b3b6ee2..bece6648d 100644 --- a/tests/optimize/test_hyperopt.py +++ b/tests/optimize/test_hyperopt.py @@ -22,9 +22,6 @@ from tests.conftest import (CURRENT_TEST_STRATEGY, get_args, log_has, log_has_re patched_configuration_load_config_file) -# TODO-lev: This file - - def test_setup_hyperopt_configuration_without_arguments(mocker, default_conf, caplog) -> None: patched_configuration_load_config_file(mocker, default_conf) diff --git a/tests/test_freqtradebot.py b/tests/test_freqtradebot.py index 10b0f0c3f..1798d97e8 100644 --- a/tests/test_freqtradebot.py +++ b/tests/test_freqtradebot.py @@ -2961,7 +2961,7 @@ def test_execute_trade_exit_down(default_conf_usdt, ticker_usdt, fee, ticker_usd @pytest.mark.parametrize( "is_short,amount,open_rate,current_rate,limit,profit_amount,profit_ratio,profit_or_loss", [ (False, 30, 2.0, 2.3, 2.25, 7.18125, 0.11938903, 'profit'), - (True, 29.70297029, 2.02, 2.2, 2.25, -7.14876237, -0.11944465, 'loss'), # TODO-lev + (True, 29.70297029, 2.02, 2.2, 2.25, -7.14876237, -0.11944465, 'loss'), ]) def test_execute_trade_exit_custom_exit_price( default_conf_usdt, ticker_usdt, fee, ticker_usdt_sell_up, is_short, amount, open_rate, diff --git a/tests/test_persistence.py b/tests/test_persistence.py index 3fd86bbe0..a2d9f37bb 100644 --- a/tests/test_persistence.py +++ b/tests/test_persistence.py @@ -1893,17 +1893,20 @@ def test_total_open_trades_stakes(fee, is_short, use_db): @pytest.mark.usefixtures("init_persistence") -# TODO-lev: @pytest.mark.parametrize('is_short', [True, False]) +@pytest.mark.parametrize('is_short,result', [ + (True, -0.006739127), + (False, 0.000739127), +]) @pytest.mark.parametrize('use_db', [True, False]) -def test_get_total_closed_profit(fee, use_db): +def test_get_total_closed_profit(fee, use_db, is_short, result): Trade.use_db = use_db Trade.reset_trades() res = Trade.get_total_closed_profit() assert res == 0 - create_mock_trades(fee, False, use_db) + create_mock_trades(fee, is_short, use_db) res = Trade.get_total_closed_profit() - assert res == 0.000739127 + assert res == result Trade.use_db = True @@ -1956,17 +1959,20 @@ def test_get_overall_performance(fee): @pytest.mark.usefixtures("init_persistence") -# TODO-lev: @pytest.mark.parametrize('is_short', [True, False]) -def test_get_best_pair(fee): +@pytest.mark.parametrize('is_short,pair,profit', [ + (True, 'ETC/BTC', -0.005), + (False, 'XRP/BTC', 0.01), +]) +def test_get_best_pair(fee, is_short, pair, profit): res = Trade.get_best_pair() assert res is None - create_mock_trades(fee, False) + create_mock_trades(fee, is_short) res = Trade.get_best_pair() assert len(res) == 2 - assert res[0] == 'XRP/BTC' - assert res[1] == 0.01 + assert res[0] == pair + assert res[1] == profit @pytest.mark.usefixtures("init_persistence")