Merge pull request #1040 from freqtrade/xmatthias_backtest_duration

Fix backtest duration calculation
This commit is contained in:
Janne Sinivirta
2018-07-19 17:32:11 +03:00
committed by GitHub
2 changed files with 14 additions and 11 deletions

View File

@@ -391,15 +391,14 @@ def test_generate_text_table(default_conf, mocker):
result_str = (
'| pair | buy count | avg profit % | cum profit % | '
'total profit BTC | avg duration | profit | loss |\n'
'total profit BTC | avg duration | profit | loss |\n'
'|:--------|------------:|---------------:|---------------:|'
'-------------------:|---------------:|---------:|-------:|\n'
'-------------------:|:---------------|---------:|-------:|\n'
'| ETH/BTC | 2 | 15.00 | 30.00 | '
'0.60000000 | 20.0 | 2 | 0 |\n'
'0.60000000 | 0:20:00 | 2 | 0 |\n'
'| TOTAL | 2 | 15.00 | 30.00 | '
'0.60000000 | 20.0 | 2 | 0 |'
'0.60000000 | 0:20:00 | 2 | 0 |'
)
print(result_str)
assert backtesting._generate_text_table(data={'ETH/BTC': {}}, results=results) == result_str