Add test for generate_backtest_stats

This commit is contained in:
Matthias
2020-06-26 20:08:45 +02:00
parent af9a9592b7
commit 03ab61959b
2 changed files with 82 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
import logging
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone
from pathlib import Path
from typing import Any, Dict, List
@@ -266,10 +266,10 @@ def generate_backtest_stats(config: Dict, btdata: Dict[str, DataFrame],
except ValueError:
strat_stats.update({
'max_drawdown': 0.0,
'drawdown_start': datetime.min,
'drawdown_start_ts': datetime(1970, 1, 1).timestamp(),
'drawdown_end': datetime.min,
'drawdown_end_ts': datetime(1970, 1, 1).timestamp(),
'drawdown_start': datetime(1970, 1, 1, tzinfo=timezone.utc),
'drawdown_start_ts': 0,
'drawdown_end': datetime(1970, 1, 1, tzinfo=timezone.utc),
'drawdown_end_ts': 0,
})
strategy_results = generate_strategy_metrics(stake_currency=stake_currency,