freqtradebot.get_valid_enter_price_and_stake gets min of stake_amount and max_stake_amount before calling wallets.validate_stake_amount

This commit is contained in:
Sam Germain 2022-02-03 19:22:37 -06:00
parent a50f4d2c57
commit 30c476e3c1
2 changed files with 2 additions and 0 deletions

View File

@ -866,6 +866,7 @@ class FreqtradeBot(LoggingMixin):
entry_tag=entry_tag, side=trade_side
)
stake_amount = min(stake_amount, max_stake_amount)
stake_amount = self.wallets.validate_stake_amount(pair, stake_amount, min_stake_amount)
return enter_limit_requested, stake_amount

View File

@ -743,6 +743,7 @@ def test_execute_entry(mocker, default_conf_usdt, fee, limit_order,
(open_rate - (wallet_balance / position)) / (1 - (mm_ratio + taker_fee_rate))
(10 - (2 / 1)) / (1 - (0.01 + 0.0006)) = 8.085708510208207
"""
# TODO: Parametrize this test
open_order = limit_order_open[enter_side(is_short)]
order = limit_order[enter_side(is_short)]
default_conf_usdt['trading_mode'] = trading_mode