Correctly test drawdown plot

This commit is contained in:
Matthias
2020-04-05 14:43:01 +02:00
parent e204170eb6
commit 41d5c40f10
3 changed files with 8 additions and 2 deletions

View File

@@ -206,3 +206,7 @@ def test_calculate_max_drawdown2():
# High must be before low
assert h < low
assert drawdown == 0.091755
df = DataFrame(zip(values[:5], dates[:5]), columns=['profit', 'open_time'])
with pytest.raises(ValueError, match='No losing trade, therefore no drawdown.'):
calculate_max_drawdown(df, date_col='open_time', value_col='profit')