|
|
|
@ -1,3 +1,5 @@
|
|
|
|
|
from decimal import Decimal as D
|
|
|
|
|
|
|
|
|
|
from django.contrib.auth.mixins import LoginRequiredMixin
|
|
|
|
|
from two_factor.views.mixins import OTPRequiredMixin
|
|
|
|
|
|
|
|
|
@ -29,8 +31,8 @@ class Profit(LoginRequiredMixin, OTPRequiredMixin, ObjectList):
|
|
|
|
|
details = account.client.get_account()
|
|
|
|
|
item = {
|
|
|
|
|
"account": account,
|
|
|
|
|
"pl": float(details["pl"]),
|
|
|
|
|
"unrealizedPL": float(details["unrealizedPL"]),
|
|
|
|
|
"pl": D(account.initial_balance) - D(details["balance"]),
|
|
|
|
|
"unrealizedPL": D(details["unrealizedPL"]),
|
|
|
|
|
"balance": details["balance"],
|
|
|
|
|
"currency": details["currency"],
|
|
|
|
|
}
|
|
|
|
|