Return true/false for validation function
This commit is contained in:
@@ -78,7 +78,7 @@ def get_timeframe(data: Dict[str, DataFrame]) -> Tuple[arrow.Arrow, arrow.Arrow]
|
||||
|
||||
|
||||
def validate_backtest_data(data: Dict[str, DataFrame], min_date: datetime,
|
||||
max_date: datetime, ticker_interval_mins: int) -> None:
|
||||
max_date: datetime, ticker_interval_mins: int) -> bool:
|
||||
"""
|
||||
Validates preprocessed backtesting data for missing values and shows warnings about it that.
|
||||
|
||||
@@ -89,10 +89,13 @@ def validate_backtest_data(data: Dict[str, DataFrame], min_date: datetime,
|
||||
"""
|
||||
# total difference in minutes / interval-minutes
|
||||
expected_frames = int((max_date - min_date).total_seconds() // 60 // ticker_interval_mins)
|
||||
found_missing = False
|
||||
for pair, df in data.items():
|
||||
if len(df) < expected_frames:
|
||||
found_missing = True
|
||||
logger.warning('%s has missing frames: expected %s, got %s',
|
||||
pair, expected_frames, len(df))
|
||||
return found_missing
|
||||
|
||||
|
||||
def load_tickerdata_file(
|
||||
|
Reference in New Issue
Block a user