From 430aa0903f6e698e39739c7de1b318ea78d55c4d Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Sat, 13 Nov 2021 19:45:41 -0600 Subject: [PATCH] Removed redundent TODO-levs --- freqtrade/exchange/binance.py | 7 ++++--- freqtrade/exchange/bybit.py | 5 +++-- freqtrade/exchange/ftx.py | 5 +++-- freqtrade/exchange/gateio.py | 7 ++++--- freqtrade/exchange/kraken.py | 5 +++-- freqtrade/exchange/okex.py | 7 ++++--- freqtrade/freqtradebot.py | 5 ++--- freqtrade/persistence/models.py | 4 ++-- tests/conftest_trades.py | 2 +- 9 files changed, 26 insertions(+), 21 deletions(-) diff --git a/freqtrade/exchange/binance.py b/freqtrade/exchange/binance.py index c16566fde..ba3528949 100644 --- a/freqtrade/exchange/binance.py +++ b/freqtrade/exchange/binance.py @@ -33,9 +33,10 @@ class Binance(Exchange): _supported_trading_mode_collateral_pairs: List[Tuple[TradingMode, Collateral]] = [ # TradingMode.SPOT always supported and not required in this list - # (TradingMode.MARGIN, Collateral.CROSS), # TODO-lev: Uncomment once supported - # (TradingMode.FUTURES, Collateral.CROSS), # TODO-lev: Uncomment once supported - # (TradingMode.FUTURES, Collateral.ISOLATED) # TODO-lev: Uncomment once supported + # TODO-lev: Uncomment once supported + # (TradingMode.MARGIN, Collateral.CROSS), + # (TradingMode.FUTURES, Collateral.CROSS), + # (TradingMode.FUTURES, Collateral.ISOLATED) ] @property diff --git a/freqtrade/exchange/bybit.py b/freqtrade/exchange/bybit.py index df19a671b..31152d6c1 100644 --- a/freqtrade/exchange/bybit.py +++ b/freqtrade/exchange/bybit.py @@ -27,6 +27,7 @@ class Bybit(Exchange): _supported_trading_mode_collateral_pairs: List[Tuple[TradingMode, Collateral]] = [ # TradingMode.SPOT always supported and not required in this list - # (TradingMode.FUTURES, Collateral.CROSS), # TODO-lev: Uncomment once supported - # (TradingMode.FUTURES, Collateral.ISOLATED) # TODO-lev: Uncomment once supported + # 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 2acf32ba3..d8df8bc97 100644 --- a/freqtrade/exchange/ftx.py +++ b/freqtrade/exchange/ftx.py @@ -25,8 +25,9 @@ class Ftx(Exchange): _supported_trading_mode_collateral_pairs: List[Tuple[TradingMode, Collateral]] = [ # TradingMode.SPOT always supported and not required in this list - # (TradingMode.MARGIN, Collateral.CROSS), # TODO-lev: Uncomment once supported - # (TradingMode.FUTURES, Collateral.CROSS) # TODO-lev: Uncomment once supported + # TODO-lev: Uncomment once supported + # (TradingMode.MARGIN, Collateral.CROSS), + # (TradingMode.FUTURES, Collateral.CROSS) ] def market_is_tradable(self, market: Dict[str, Any]) -> bool: diff --git a/freqtrade/exchange/gateio.py b/freqtrade/exchange/gateio.py index 83abd1266..eb5d244aa 100644 --- a/freqtrade/exchange/gateio.py +++ b/freqtrade/exchange/gateio.py @@ -30,9 +30,10 @@ class Gateio(Exchange): _supported_trading_mode_collateral_pairs: List[Tuple[TradingMode, Collateral]] = [ # TradingMode.SPOT always supported and not required in this list - # (TradingMode.MARGIN, Collateral.CROSS), # TODO-lev: Uncomment once supported - # (TradingMode.FUTURES, Collateral.CROSS), # TODO-lev: Uncomment once supported - # (TradingMode.FUTURES, Collateral.ISOLATED) # TODO-lev: Uncomment once supported + # TODO-lev: Uncomment once supported + # (TradingMode.MARGIN, Collateral.CROSS), + # (TradingMode.FUTURES, Collateral.CROSS), + # (TradingMode.FUTURES, Collateral.ISOLATED) ] @property diff --git a/freqtrade/exchange/kraken.py b/freqtrade/exchange/kraken.py index 8bd5d2fb3..6d0294e1c 100644 --- a/freqtrade/exchange/kraken.py +++ b/freqtrade/exchange/kraken.py @@ -27,8 +27,9 @@ class Kraken(Exchange): _supported_trading_mode_collateral_pairs: List[Tuple[TradingMode, Collateral]] = [ # TradingMode.SPOT always supported and not required in this list - # (TradingMode.MARGIN, Collateral.CROSS), # TODO-lev: Uncomment once supported - # (TradingMode.FUTURES, Collateral.CROSS) # TODO-lev: No CCXT support + # TODO-lev: Uncomment once supported + # (TradingMode.MARGIN, Collateral.CROSS), + # (TradingMode.FUTURES, Collateral.CROSS) ] def market_is_tradable(self, market: Dict[str, Any]) -> bool: diff --git a/freqtrade/exchange/okex.py b/freqtrade/exchange/okex.py index 100bf3adf..cade318a5 100644 --- a/freqtrade/exchange/okex.py +++ b/freqtrade/exchange/okex.py @@ -21,9 +21,10 @@ class Okex(Exchange): _supported_trading_mode_collateral_pairs: List[Tuple[TradingMode, Collateral]] = [ # TradingMode.SPOT always supported and not required in this list - # (TradingMode.MARGIN, Collateral.CROSS), # TODO-lev: Uncomment once supported - # (TradingMode.FUTURES, Collateral.CROSS), # TODO-lev: Uncomment once supported - # (TradingMode.FUTURES, Collateral.ISOLATED) # TODO-lev: Uncomment once supported + # TODO-lev: Uncomment once supported + # (TradingMode.MARGIN, Collateral.CROSS), + # (TradingMode.FUTURES, Collateral.CROSS), + # (TradingMode.FUTURES, Collateral.ISOLATED) ] @property diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 8369a8579..092d658c2 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -922,8 +922,7 @@ class FreqtradeBot(LoggingMixin): Check if trade is fulfilled in which case the stoploss on exchange should be added immediately if stoploss on exchange is enabled. - # TODO-lev: liquidation price will always be on exchange, even though - # TODO-lev: stoploss_on_exchange might not be enabled + # TODO-lev: liquidation price always on exchange, even without stoploss_on_exchange """ logger.debug('Handling stoploss on exchange %s ...', trade) @@ -1517,7 +1516,7 @@ class FreqtradeBot(LoggingMixin): self.wallets.update() if fee_abs != 0 and self.wallets.get_free(trade_base_currency) >= amount: # Eat into dust if we own more than base currency - # TODO-lev: won't be in base currency for shorts + # TODO-lev: settle currency for futures logger.info(f"Fee amount for {trade} was in base currency - " f"Eating Fee {fee_abs} into dust.") elif fee_abs != 0: diff --git a/freqtrade/persistence/models.py b/freqtrade/persistence/models.py index 4835a1772..9ba88057c 100644 --- a/freqtrade/persistence/models.py +++ b/freqtrade/persistence/models.py @@ -916,8 +916,8 @@ class Trade(_DECL_BASE, LocalTrade): max_rate = Column(Float, nullable=True, default=0.0) # Lowest price reached min_rate = Column(Float, nullable=True) - sell_reason = Column(String(100), nullable=True) # TODO-lev: Change to close_reason - sell_order_status = Column(String(100), nullable=True) # TODO-lev: Change to close_order_status + sell_reason = Column(String(100), nullable=True) + sell_order_status = Column(String(100), nullable=True) strategy = Column(String(100), nullable=True) buy_tag = Column(String(100), nullable=True) timeframe = Column(Integer, nullable=True) diff --git a/tests/conftest_trades.py b/tests/conftest_trades.py index c13b482dc..dcd5e70df 100644 --- a/tests/conftest_trades.py +++ b/tests/conftest_trades.py @@ -488,7 +488,7 @@ def leverage_trade(fee): open_order_id='dry_run_leverage_buy_12368', strategy='DefaultStrategy', timeframe=5, - sell_reason='sell_signal', # TODO-lev: Update to exit/close reason + sell_reason='sell_signal', open_date=datetime.now(tz=timezone.utc) - timedelta(minutes=300), close_date=datetime.now(tz=timezone.utc), interest_rate=0.0005