Implement last_stake_amount_min_ratio

This commit is contained in:
Matthias
2020-01-10 06:36:28 +01:00
parent e94dfdeff2
commit fab19ae3a7
5 changed files with 28 additions and 8 deletions

View File

@@ -140,14 +140,18 @@ def test_get_trade_stake_amount(default_conf, ticker, mocker) -> None:
assert result == default_conf['stake_amount']
@pytest.mark.parametrize("amend_last,wallet,max_open,expected", [
(False, 0.002, 2, [0.001, None]),
(True, 0.002, 2, [0.001, 0.00098]),
(False, 0.003, 3, [0.001, 0.001, None]),
(True, 0.003, 3, [0.001, 0.001, 0.00097]),
@pytest.mark.parametrize("amend_last,wallet,max_open,lsamr,expected", [
(False, 0.002, 2, 0.5, [0.001, None]),
(True, 0.002, 2, 0.5, [0.001, 0.00098]),
(False, 0.003, 3, 0.5, [0.001, 0.001, None]),
(True, 0.003, 3, 0.5, [0.001, 0.001, 0.00097]),
(False, 0.0022, 3, 0.5, [0.001, 0.001, None]),
(True, 0.0022, 3, 0.5, [0.001, 0.001, 0.0]),
(True, 0.0027, 3, 0.5, [0.001, 0.001, 0.000673]),
(True, 0.0022, 3, 1, [0.001, 0.001, 0.0]),
])
def test_check_available_stake_amount(default_conf, ticker, mocker, fee, limit_buy_order,
amend_last, wallet, max_open, expected) -> None:
amend_last, wallet, max_open, lsamr, expected) -> None:
patch_RPCManager(mocker)
patch_exchange(mocker)
mocker.patch.multiple(
@@ -160,6 +164,8 @@ def test_check_available_stake_amount(default_conf, ticker, mocker, fee, limit_b
default_conf['dry_run_wallet'] = wallet
default_conf['amend_last_stake_amount'] = amend_last
default_conf['last_stake_amount_min_ratio'] = lsamr
freqtrade = FreqtradeBot(default_conf)
for i in range(0, max_open):