Move total_trades to explicit variable

This commit is contained in:
Matthias 2023-03-13 19:21:53 +01:00
parent 1947fab3d7
commit d723979c42

View File

@ -388,12 +388,13 @@ class RPC:
Trade.close_date.desc())
output = [trade.to_json() for trade in trades]
total_trades = Trade.get_trades([Trade.is_open.is_(False)]).count()
return {
"trades": output,
"trades_count": len(output),
"offset": offset,
"total_trades": Trade.get_trades([Trade.is_open.is_(False)]).count(),
"total_trades": total_trades,
}
def _rpc_stats(self) -> Dict[str, Any]: