From 5cf2dd79f27351880ad685d1ef78bd45dae87730 Mon Sep 17 00:00:00 2001 From: Janne Sinivirta Date: Tue, 6 Feb 2018 11:33:38 +0200 Subject: [PATCH] don't reset index if not needed --- freqtrade/optimize/backtesting.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index e7d2a0d8e..ea03803fc 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -120,7 +120,8 @@ def backtest(args) -> DataFrame: for pair, pair_data in processed.items(): pair_data['buy'], pair_data['sell'] = 0, 0 ticker = populate_sell_trend(populate_buy_trend(pair_data)) - ticker.set_index('date', inplace=True) + if 'date' in ticker: + ticker.set_index('date', inplace=True) # for each buy point lock_pair_until = None headers = ['buy', 'open', 'close', 'sell']