From c35d1b9c9d3b7a94b9cfc3b00e89976fd4b2a5fe Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 5 Jul 2018 23:22:35 +0200 Subject: [PATCH] Add test which checks the backtest result --- freqtrade/tests/optimize/test_backtesting.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/freqtrade/tests/optimize/test_backtesting.py b/freqtrade/tests/optimize/test_backtesting.py index cb225e465..10fd1351b 100644 --- a/freqtrade/tests/optimize/test_backtesting.py +++ b/freqtrade/tests/optimize/test_backtesting.py @@ -499,6 +499,22 @@ def test_backtest(default_conf, fee, mocker) -> None: assert not results.empty assert len(results) == 2 + expected = pd.DataFrame( + {'pair': ['UNITTEST/BTC', 'UNITTEST/BTC'], + 'profit_percent': [0.00148826, 0.00075313], + 'profit_abs': [1.49e-06, 7.6e-07], + 'open_time': [Arrow(2018, 1, 29, 18, 40, 0).datetime, + Arrow(2018, 1, 30, 3, 30, 0).datetime], + 'close_time': [Arrow(2018, 1, 29, 23, 15, 0).datetime, + Arrow(2018, 1, 30, 4, 20, 0).datetime], + 'open_index': [77, 183], + 'close_index': [132, 193], + 'trade_duration': [275, 50], + 'open_at_end': [False, False], + 'open_rate': [0.10432, 0.103364], + 'close_rate': [0.104999, 0.10396]}) + pd.testing.assert_frame_equal(results, expected) + def test_backtest_1min_ticker_interval(default_conf, fee, mocker) -> None: """