Update /profit telegram message to support non-closed trades

This commit is contained in:
Matthias
2020-05-29 09:38:12 +02:00
parent 6261aef314
commit 1d6e3fea85
4 changed files with 24 additions and 15 deletions

View File

@@ -310,6 +310,7 @@ class RPC:
'profit_all_percent': profit_all_percent,
'profit_all_fiat': profit_all_fiat,
'trade_count': len(trades),
'closed_trade_count': len([t for t in trades if not t.is_open]),
'first_trade_date': arrow.get(first_date).humanize() if first_date else '',
'first_trade_timestamp': int(first_date.timestamp() * 1000) if first_date else 0,
'latest_trade_date': arrow.get(last_date).humanize() if last_date else '',