Add base backtest filter class
This commit is contained in:
parent
31c60d10e3
commit
e688c3150f
13
backtesting/filter/backtest_filter.py
Normal file
13
backtesting/filter/backtest_filter.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
from datetime import datetime
|
||||||
|
from pandas import DataFrame
|
||||||
|
|
||||||
|
class BacktestFilter:
|
||||||
|
|
||||||
|
backtest_filter: DataFrame = None
|
||||||
|
|
||||||
|
def filter(self) -> DataFrame:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def trade_allowed(self, date: datetime) -> bool:
|
||||||
|
filtered_dates = self.backtest_filter[self.backtest_filter['Date'] == date]
|
||||||
|
return filtered_dates.empty or filtered_dates['Trade Allowed'].values[0]
|
Loading…
Reference in New Issue
Block a user