Query filters using datetime set to midnight regardless of what the caller provides as this is what is expected of the data
This commit is contained in:
parent
517e70b471
commit
788f238530
@ -9,5 +9,6 @@ class BacktestFilter:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def trade_allowed(self, date: datetime) -> bool:
|
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]
|
filtered_dates = self.backtest_filter[self.backtest_filter['Date'] == date]
|
||||||
return filtered_dates.empty or filtered_dates['Trade Allowed'].values[0]
|
return filtered_dates.empty or filtered_dates['Trade Allowed'].values[0]
|
Loading…
Reference in New Issue
Block a user