diff --git a/backtesting/filter/backtest_filter.py b/backtesting/filter/backtest_filter.py index 15fc9eb..709d88f 100644 --- a/backtesting/filter/backtest_filter.py +++ b/backtesting/filter/backtest_filter.py @@ -9,5 +9,6 @@ class BacktestFilter: pass def trade_allowed(self, date: datetime) -> bool: + date = datetime.combine(date, datetime.min.time()) # Enforcing midnight. filtered_dates = self.backtest_filter[self.backtest_filter['Date'] == date] return filtered_dates.empty or filtered_dates['Trade Allowed'].values[0] \ No newline at end of file