From ffdbcecc8d017ae1050b768250b32d09e697c328 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 16 Feb 2023 07:20:41 +0000 Subject: [PATCH] Do profit calculation the right way around --- core/views/profit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/views/profit.py b/core/views/profit.py index c231f3c..3222cd1 100644 --- a/core/views/profit.py +++ b/core/views/profit.py @@ -31,7 +31,7 @@ class Profit(LoginRequiredMixin, OTPRequiredMixin, ObjectList): details = account.client.get_account() item = { "account": account, - "pl": D(account.initial_balance) - D(details["balance"]), + "pl": D(details["balance"]) - D(account.initial_balance), "unrealizedPL": D(details["unrealizedPL"]), "balance": details["balance"], "currency": details["currency"],