From 1d4eeacc6df58fde771c60ef00ac444d8be390de Mon Sep 17 00:00:00 2001 From: adriance Date: Mon, 14 Mar 2022 17:55:42 +0800 Subject: [PATCH] fix test_backtest__enter_trade_futures row data error --- tests/optimize/test_backtesting.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/optimize/test_backtesting.py b/tests/optimize/test_backtesting.py index 0d15c23e8..50c383346 100644 --- a/tests/optimize/test_backtesting.py +++ b/tests/optimize/test_backtesting.py @@ -581,14 +581,18 @@ def test_backtest__enter_trade_futures(default_conf_usdt, fee, mocker) -> None: backtesting._set_strategy(backtesting.strategylist[0]) pair = 'UNITTEST/USDT:USDT' row = [ - pd.Timestamp(year=2020, month=1, day=1, hour=5, minute=0), - 1, # Buy - 0.001, # Open - 0.0011, # Close - 0, # Sell - 0.00099, # Low - 0.0012, # High - '', # Buy Signal Name + pd.Timestamp(year=2020, month=1, day=1, hour=5, minute=0), + 0.001, # Open + 0.0012, # High + 0.00099, # Low + 0.0011, # Close + 1, # enter_long + 0, # exit_long + 1, # enter_short + 0, # exit_hsort + '',# Long Signal Name + '', # Short Signal Name + '', # Exit Signal Name ] backtesting.strategy.leverage = MagicMock(return_value=5.0)