Convert winrate to ratio instead of % in calculations

This commit is contained in:
froggleston
2023-07-18 22:25:17 +01:00
parent 6ccc12f337
commit f95f954df7
4 changed files with 11 additions and 11 deletions

View File

@@ -415,15 +415,15 @@ def test_rpc_trade_statistics(default_conf_usdt, ticker, fee, mocker) -> None:
assert pytest.approx(stats['profit_all_coin']) == -77.45964918
assert pytest.approx(stats['profit_all_percent_mean']) == -57.86
assert pytest.approx(stats['profit_all_fiat']) == -85.205614098
assert pytest.approx(stats['winrate']) == 66.666666667
assert pytest.approx(stats['expectancy']) == 0.9133333333333327
assert pytest.approx(stats['winrate']) == 0.666666667
assert pytest.approx(stats['expectancy']) == 0.913333333
assert pytest.approx(stats['expectancy_ratio']) == 0.223308883
assert stats['trade_count'] == 7
assert stats['first_trade_humanized'] == '2 days ago'
assert stats['latest_trade_humanized'] == '17 minutes ago'
assert stats['avg_duration'] in ('0:17:40')
assert stats['best_pair'] == 'XRP/USDT'
assert stats['best_rate'] == 10.0
assert stats['expectancy_ratio'] == 0.22330888345558253
# Test non-available pair
mocker.patch(f'{EXMS}.get_rate',