Fix bug in example.

This commit is contained in:
Reigo Reinmets 2021-12-11 19:45:30 +02:00
parent 2e13893341
commit 64558e60d3
1 changed files with 3 additions and 1 deletions

View File

@ -274,7 +274,9 @@ class DigDeeperStrategy(IStrategy):
dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)
# Only buy when not actively falling price.
if dataframe['close'] < dataframe['close'].shift(1):
last_candle = dataframe.iloc[-1].squeeze()
previous_candle = dataframe.iloc[-2].squeeze()
if last_candle.close < previous_candle.close:
return None
count_of_buys = 0