Add simple test for /stats call

This commit is contained in:
Matthias
2020-12-05 14:48:56 +01:00
parent aa27c9ace2
commit 245c19f5e9
3 changed files with 39 additions and 2 deletions

View File

@@ -280,9 +280,9 @@ class RPC:
Generate generic stats for trades in database
"""
def trade_win_loss(trade):
if trade.close_profit_abs > 0:
if trade.close_profit > 0:
return 'Wins'
elif trade.close_profit_abs < 0:
elif trade.close_profit < 0:
return 'Losses'
else:
return 'Draws'