Pass current_time to confirm_trade_entry/confirm_trade_exit.

This commit is contained in:
Rokas Kupstys
2021-05-02 12:20:25 +03:00
parent d34da3f981
commit dc6e702fec
3 changed files with 12 additions and 7 deletions

View File

@@ -36,9 +36,11 @@ def test_default_strategy(result, fee):
)
assert strategy.confirm_trade_entry(pair='ETH/BTC', order_type='limit', amount=0.1,
rate=20000, time_in_force='gtc') is True
rate=20000, time_in_force='gtc',
current_time=datetime.utcnow()) is True
assert strategy.confirm_trade_exit(pair='ETH/BTC', trade=trade, order_type='limit', amount=0.1,
rate=20000, time_in_force='gtc', sell_reason='roi') is True
rate=20000, time_in_force='gtc', sell_reason='roi',
current_time=datetime.utcnow()) is True
assert strategy.custom_stoploss(pair='ETH/BTC', trade=trade, current_time=datetime.now(),
current_rate=20_000, current_profit=0.05) == strategy.stoploss