Add starting balance to profit cumsum calculation

This commit is contained in:
Matthias
2021-02-16 20:12:59 +01:00
parent 0d2f877e77
commit aed23d55c2
2 changed files with 9 additions and 3 deletions

View File

@@ -296,6 +296,11 @@ def test_calculate_csum(testdatadir):
assert isinstance(csum_max, float)
assert csum_min < 0.01
assert csum_max > 0.02
csum_min1, csum_max1 = calculate_csum(bt_data, 5)
assert csum_min1 == csum_min + 5
assert csum_max1 == csum_max + 5
with pytest.raises(ValueError, match='Trade dataframe empty.'):
csum_min, csum_max = calculate_csum(DataFrame())