mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-02-19 19:01:06 +00:00
Simplify backtesting by using current_time more consequently
This commit is contained in:
@@ -665,7 +665,7 @@ def test_backtest__check_trade_exit(default_conf, fee, mocker) -> None:
|
||||
]
|
||||
|
||||
# No data available.
|
||||
res = backtesting._check_trade_exit(trade, row_sell)
|
||||
res = backtesting._check_trade_exit(trade, row_sell, row_sell[0].to_pydatetime())
|
||||
assert res is not None
|
||||
assert res.exit_reason == ExitType.ROI.value
|
||||
assert res.close_date_utc == datetime(2020, 1, 1, 5, 0, tzinfo=timezone.utc)
|
||||
@@ -678,7 +678,7 @@ def test_backtest__check_trade_exit(default_conf, fee, mocker) -> None:
|
||||
[], columns=['date', 'open', 'high', 'low', 'close', 'enter_long', 'exit_long',
|
||||
'enter_short', 'exit_short', 'long_tag', 'short_tag', 'exit_tag'])
|
||||
|
||||
res = backtesting._check_trade_exit(trade, row)
|
||||
res = backtesting._check_trade_exit(trade, row, row[0].to_pydatetime())
|
||||
assert res is None
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user