diff --git a/lumibot/entities/bars.py b/lumibot/entities/bars.py index 14a29ec68..08876fc3e 100644 --- a/lumibot/entities/bars.py +++ b/lumibot/entities/bars.py @@ -555,7 +555,7 @@ def get_last_price(self) -> Union[float, Decimal, None]: float, Decimal or None """ - return self.df["close"][-1] + return self.df["close"].iloc[-1] def get_last_dividend(self): """Return the last dividend of the last bar @@ -569,7 +569,7 @@ def get_last_dividend(self): float """ if "dividend" in self.df.columns: - return self.df["dividend"][-1] + return self.df["dividend"].iloc[-1] else: logger.debug("Unable to find 'dividend' column in bars") return 0