From 64558e60d38b826ec715e544c629120d279206e5 Mon Sep 17 00:00:00 2001 From: Reigo Reinmets Date: Sat, 11 Dec 2021 19:45:30 +0200 Subject: [PATCH] Fix bug in example. --- docs/strategy-advanced.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/strategy-advanced.md b/docs/strategy-advanced.md index c3527ec54..523d0accd 100644 --- a/docs/strategy-advanced.md +++ b/docs/strategy-advanced.md @@ -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