From 082fb11bbedde8a9521f72c1018a1f2ba73357fc Mon Sep 17 00:00:00 2001 From: Kamontat Chantrachirathumrong Date: Thu, 20 May 2021 01:54:48 +0700 Subject: [PATCH] Avoid having error `cannot set a frame with no defined index and a scalar` --- freqtrade/optimize/backtesting.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index c6b05c8c6..e6172282b 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -191,8 +191,8 @@ class Backtesting: data: Dict = {} # Create dict with data for pair, pair_data in processed.items(): - pair_data.loc[:, 'buy'] = 0 # cleanup from previous run - pair_data.loc[:, 'sell'] = 0 # cleanup from previous run + pair_data['buy'] = 0 # cleanup from previous run + pair_data['sell'] = 0 # cleanup from previous run df_analyzed = self.strategy.advise_sell( self.strategy.advise_buy(pair_data, {'pair': pair}), {'pair': pair})[headers].copy()