Do profit calculation the right way around

This commit is contained in:
Mark Veidemanis 2023-02-16 07:20:41 +00:00
parent c0f266da73
commit ffdbcecc8d
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 1 additions and 1 deletions

View File

@ -31,7 +31,7 @@ class Profit(LoginRequiredMixin, OTPRequiredMixin, ObjectList):
details = account.client.get_account() details = account.client.get_account()
item = { item = {
"account": account, "account": account,
"pl": D(account.initial_balance) - D(details["balance"]), "pl": D(details["balance"]) - D(account.initial_balance),
"unrealizedPL": D(details["unrealizedPL"]), "unrealizedPL": D(details["unrealizedPL"]),
"balance": details["balance"], "balance": details["balance"],
"currency": details["currency"], "currency": details["currency"],