Merge pull request #5874 from samgermain/update-todos

Removed unnecessary todo comments
This commit is contained in:
Matthias 2021-11-10 15:22:50 +01:00 committed by GitHub
commit 2e451da08f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 21 deletions

View File

@ -1612,7 +1612,6 @@ class Exchange:
:param since: The earliest time of consideration for calculating funding fees,
in unix time or as a datetime
"""
# TODO-lev: Add dry-run handling for this.
if not self.exchange_has("fetchFundingHistory"):
raise OperationalException(

View File

@ -617,8 +617,9 @@ class FreqtradeBot(LoggingMixin):
default_retval=stake_amount)(
pair=pair, current_time=datetime.now(timezone.utc),
current_rate=enter_limit_requested, proposed_stake=stake_amount,
min_stake=min_stake_amount, max_stake=max_stake_amount, side='long')
# TODO-lev: Add non-hardcoded "side" parameter
min_stake=min_stake_amount, max_stake=max_stake_amount,
side='short' if is_short else 'long'
)
stake_amount = self.wallets._validate_stake_amount(pair, stake_amount, min_stake_amount)
@ -638,7 +639,6 @@ class FreqtradeBot(LoggingMixin):
order_type = self.strategy.order_types.get('forcebuy', order_type)
# TODO-lev: Will this work for shorting?
# TODO-lev: Add non-hardcoded "side" parameter
if not strategy_safe_wrapper(self.strategy.confirm_trade_entry, default_retval=True)(
pair=pair, order_type=order_type, amount=amount, rate=enter_limit_requested,
time_in_force=time_in_force, current_time=datetime.now(timezone.utc),

View File

@ -906,7 +906,6 @@ def test_execute_entry_confirm_error(mocker, default_conf_usdt, fee, limit_order
pair = 'ETH/USDT'
freqtrade.strategy.confirm_trade_entry = MagicMock(side_effect=ValueError)
# TODO-lev: KeyError happens on short, why?
assert freqtrade.execute_entry(pair, stake_amount)
limit_order[enter_side(is_short)]['id'] = '222'
@ -1228,7 +1227,6 @@ def test_create_stoploss_order_insufficient_funds(
def test_handle_stoploss_on_exchange_trailing(
mocker, default_conf_usdt, fee, is_short, bid, ask, limit_order, stop_price, amt, hang_price
) -> None:
# TODO-lev: test for short
# When trailing stoploss is set
enter_order = limit_order[enter_side(is_short)]
exit_order = limit_order[exit_side(is_short)]
@ -1435,7 +1433,6 @@ def test_handle_stoploss_on_exchange_custom_stop(
enter_order = limit_order[enter_side(is_short)]
exit_order = limit_order[exit_side(is_short)]
# When trailing stoploss is set
# TODO-lev: test for short
stoploss = MagicMock(return_value={'id': 13434334})
patch_RPCManager(mocker)
mocker.patch.multiple(
@ -2973,9 +2970,11 @@ def test_execute_trade_exit_custom_exit_price(
# Set a custom exit price
freqtrade.strategy.custom_exit_price = lambda **kwargs: 2.25
# TODO-lev: side="buy"
freqtrade.execute_trade_exit(trade=trade, limit=ticker_usdt_sell_up()['bid'],
sell_reason=SellCheckTuple(sell_type=SellType.SELL_SIGNAL))
freqtrade.execute_trade_exit(
trade=trade,
limit=ticker_usdt_sell_up()['ask' if is_short else 'bid'],
sell_reason=SellCheckTuple(sell_type=SellType.SELL_SIGNAL)
)
# Sell price must be different to default bid price
@ -3098,7 +3097,6 @@ def test_execute_trade_exit_sloe_cancel_exception(
freqtrade.config['dry_run'] = False
trade.stoploss_order_id = "abcd"
# TODO-lev: side="buy"
freqtrade.execute_trade_exit(trade=trade, limit=1234,
sell_reason=SellCheckTuple(sell_type=SellType.STOP_LOSS))
assert create_order_mock.call_count == 2
@ -3152,9 +3150,11 @@ def test_execute_trade_exit_with_stoploss_on_exchange(
fetch_ticker=ticker_usdt_sell_up
)
# TODO-lev: side="buy"
freqtrade.execute_trade_exit(trade=trade, limit=ticker_usdt_sell_up()['bid'],
sell_reason=SellCheckTuple(sell_type=SellType.STOP_LOSS))
freqtrade.execute_trade_exit(
trade=trade,
limit=ticker_usdt_sell_up()['ask' if is_short else 'bid'],
sell_reason=SellCheckTuple(sell_type=SellType.STOP_LOSS)
)
trade = Trade.query.first()
trade.is_short = is_short
@ -3288,7 +3288,6 @@ def test_execute_trade_exit_market_order(
)
freqtrade.config['order_types']['sell'] = 'market'
# TODO-lev: side="buy"
freqtrade.execute_trade_exit(
trade=trade,
limit=ticker_usdt_sell_up()['ask' if is_short else 'bid'],
@ -3354,9 +3353,11 @@ def test_execute_trade_exit_insufficient_funds_error(default_conf_usdt, ticker_u
)
sell_reason = SellCheckTuple(sell_type=SellType.ROI)
# TODO-lev: side="buy"
assert not freqtrade.execute_trade_exit(trade=trade, limit=ticker_usdt_sell_up()['bid'],
sell_reason=sell_reason)
assert not freqtrade.execute_trade_exit(
trade=trade,
limit=ticker_usdt_sell_up()['ask' if is_short else 'bid'],
sell_reason=sell_reason
)
assert mock_insuf.call_count == 1
@ -3517,9 +3518,11 @@ def test_locked_pairs(default_conf_usdt, ticker_usdt, fee,
fetch_ticker=ticker_usdt_sell_down
)
# TODO-lev: side="buy"
freqtrade.execute_trade_exit(trade=trade, limit=ticker_usdt_sell_down()['bid'],
sell_reason=SellCheckTuple(sell_type=SellType.STOP_LOSS))
freqtrade.execute_trade_exit(
trade=trade,
limit=ticker_usdt_sell_down()['ask' if is_short else 'bid'],
sell_reason=SellCheckTuple(sell_type=SellType.STOP_LOSS)
)
trade.close(ticker_usdt_sell_down()['bid'])
assert freqtrade.strategy.is_pair_locked(trade.pair)