Sequence of minroi dict must be irrelevant
This commit is contained in:
parent
2b5e02fae8
commit
da6f1a3945
@ -117,8 +117,12 @@ def test_tickerdata_to_dataframe(default_conf) -> None:
|
|||||||
|
|
||||||
|
|
||||||
def test_min_roi_reached(default_conf, fee) -> None:
|
def test_min_roi_reached(default_conf, fee) -> None:
|
||||||
|
|
||||||
|
min_roi_list = [{20: 0.05, 55: 0.01, 0: 0.1},
|
||||||
|
{0: 0.1, 20: 0.05, 55: 0.01}]
|
||||||
|
for roi in min_roi_list:
|
||||||
strategy = DefaultStrategy(default_conf)
|
strategy = DefaultStrategy(default_conf)
|
||||||
strategy.minimal_roi = {0: 0.1, 20: 0.05, 55: 0.01}
|
strategy.minimal_roi = roi
|
||||||
trade = Trade(
|
trade = Trade(
|
||||||
pair='ETH/BTC',
|
pair='ETH/BTC',
|
||||||
stake_amount=0.001,
|
stake_amount=0.001,
|
||||||
@ -129,7 +133,7 @@ def test_min_roi_reached(default_conf, fee) -> None:
|
|||||||
open_rate=1,
|
open_rate=1,
|
||||||
)
|
)
|
||||||
|
|
||||||
assert not strategy.min_roi_reached(trade, 0.01, arrow.utcnow().shift(minutes=-55).datetime)
|
assert not strategy.min_roi_reached(trade, 0.02, arrow.utcnow().shift(minutes=-55).datetime)
|
||||||
assert strategy.min_roi_reached(trade, 0.12, arrow.utcnow().shift(minutes=-55).datetime)
|
assert strategy.min_roi_reached(trade, 0.12, arrow.utcnow().shift(minutes=-55).datetime)
|
||||||
|
|
||||||
assert not strategy.min_roi_reached(trade, 0.04, arrow.utcnow().shift(minutes=-39).datetime)
|
assert not strategy.min_roi_reached(trade, 0.04, arrow.utcnow().shift(minutes=-39).datetime)
|
||||||
|
Loading…
Reference in New Issue
Block a user