Merge pull request #6148 from samgermain/todos

Removed some todo-lev comments
This commit is contained in:
Matthias 2022-01-02 14:43:07 +01:00 committed by GitHub
commit c7b1352184
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 18 deletions

View File

@ -26,7 +26,6 @@ class Bybit(Exchange):
_supported_trading_mode_collateral_pairs: List[Tuple[TradingMode, Collateral]] = [ _supported_trading_mode_collateral_pairs: List[Tuple[TradingMode, Collateral]] = [
# TradingMode.SPOT always supported and not required in this list # TradingMode.SPOT always supported and not required in this list
# TODO-lev: Uncomment once supported
# (TradingMode.FUTURES, Collateral.CROSS), # (TradingMode.FUTURES, Collateral.CROSS),
# (TradingMode.FUTURES, Collateral.ISOLATED) # (TradingMode.FUTURES, Collateral.ISOLATED)
] ]

View File

@ -27,7 +27,6 @@ class Ftx(Exchange):
_supported_trading_mode_collateral_pairs: List[Tuple[TradingMode, Collateral]] = [ _supported_trading_mode_collateral_pairs: List[Tuple[TradingMode, Collateral]] = [
# TradingMode.SPOT always supported and not required in this list # TradingMode.SPOT always supported and not required in this list
# TODO-lev: Uncomment once supported
# (TradingMode.MARGIN, Collateral.CROSS), # (TradingMode.MARGIN, Collateral.CROSS),
# (TradingMode.FUTURES, Collateral.CROSS) # (TradingMode.FUTURES, Collateral.CROSS)
] ]

View File

@ -68,7 +68,6 @@ class FreqtradeBot(LoggingMixin):
init_db(self.config.get('db_url', None), clean_open_orders=self.config['dry_run']) 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) self.wallets = Wallets(self.config, self.exchange)
PairLocks.timeframe = self.config['timeframe'] PairLocks.timeframe = self.config['timeframe']
@ -1133,7 +1132,6 @@ class FreqtradeBot(LoggingMixin):
Buy cancel - cancel order Buy cancel - cancel order
:return: True if order was fully cancelled :return: True if order was fully cancelled
""" """
# TODO-lev: Pay back borrowed/interest and transfer back on leveraged trades
was_trade_fully_canceled = False was_trade_fully_canceled = False
# Cancelled orders may have the status of 'canceled' or 'closed' # Cancelled orders may have the status of 'canceled' or 'closed'
@ -1272,7 +1270,7 @@ class FreqtradeBot(LoggingMixin):
*, *,
exit_tag: Optional[str] = None, exit_tag: Optional[str] = None,
ordertype: Optional[str] = None, ordertype: Optional[str] = None,
) -> bool: ) -> bool:
""" """
Executes a trade exit for the given trade and limit Executes a trade exit for the given trade and limit
:param trade: Trade instance :param trade: Trade instance

View File

@ -22,9 +22,6 @@ from tests.conftest import (CURRENT_TEST_STRATEGY, get_args, log_has, log_has_re
patched_configuration_load_config_file) patched_configuration_load_config_file)
# TODO-lev: This file
def test_setup_hyperopt_configuration_without_arguments(mocker, default_conf, caplog) -> None: def test_setup_hyperopt_configuration_without_arguments(mocker, default_conf, caplog) -> None:
patched_configuration_load_config_file(mocker, default_conf) patched_configuration_load_config_file(mocker, default_conf)

View File

@ -2961,7 +2961,7 @@ def test_execute_trade_exit_down(default_conf_usdt, ticker_usdt, fee, ticker_usd
@pytest.mark.parametrize( @pytest.mark.parametrize(
"is_short,amount,open_rate,current_rate,limit,profit_amount,profit_ratio,profit_or_loss", [ "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'), (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( def test_execute_trade_exit_custom_exit_price(
default_conf_usdt, ticker_usdt, fee, ticker_usdt_sell_up, is_short, amount, open_rate, default_conf_usdt, ticker_usdt, fee, ticker_usdt_sell_up, is_short, amount, open_rate,

View File

@ -1893,17 +1893,21 @@ def test_total_open_trades_stakes(fee, is_short, use_db):
@pytest.mark.usefixtures("init_persistence") @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),
(None, -0.005429127),
])
@pytest.mark.parametrize('use_db', [True, False]) @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.use_db = use_db
Trade.reset_trades() Trade.reset_trades()
res = Trade.get_total_closed_profit() res = Trade.get_total_closed_profit()
assert res == 0 assert res == 0
create_mock_trades(fee, False, use_db) create_mock_trades(fee, is_short, use_db)
res = Trade.get_total_closed_profit() res = Trade.get_total_closed_profit()
assert res == 0.000739127 assert pytest.approx(res) == result
Trade.use_db = True Trade.use_db = True
@ -1956,17 +1960,21 @@ def test_get_overall_performance(fee):
@pytest.mark.usefixtures("init_persistence") @pytest.mark.usefixtures("init_persistence")
# TODO-lev: @pytest.mark.parametrize('is_short', [True, False]) @pytest.mark.parametrize('is_short,pair,profit', [
def test_get_best_pair(fee): (True, 'ETC/BTC', -0.005),
(False, 'XRP/BTC', 0.01),
(None, 'XRP/BTC', 0.01),
])
def test_get_best_pair(fee, is_short, pair, profit):
res = Trade.get_best_pair() res = Trade.get_best_pair()
assert res is None assert res is None
create_mock_trades(fee, False) create_mock_trades(fee, is_short)
res = Trade.get_best_pair() res = Trade.get_best_pair()
assert len(res) == 2 assert len(res) == 2
assert res[0] == 'XRP/BTC' assert res[0] == pair
assert res[1] == 0.01 assert res[1] == profit
@pytest.mark.usefixtures("init_persistence") @pytest.mark.usefixtures("init_persistence")