Avoid having error cannot set a frame with no defined index and a scalar

This commit is contained in:
Kamontat Chantrachirathumrong 2021-05-20 01:54:48 +07:00 committed by GitHub
parent ef4d1c24d7
commit 082fb11bbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()