Add unrealized PL to profit screen
This commit is contained in:
parent
103a15f0e3
commit
a18572ebda
|
@ -11,6 +11,7 @@
|
|||
<th>id</th>
|
||||
<th>name</th>
|
||||
<th>P/L</th>
|
||||
<th>Trade</th>
|
||||
<th>balance</th>
|
||||
<th>currency</th>
|
||||
</thead>
|
||||
|
@ -22,6 +23,7 @@
|
|||
<td>{{ item.account.id }}</td>
|
||||
<td>{{ item.account.name }}</td>
|
||||
<td>{{ item.pl }}</td>
|
||||
<td>{{ item.unrealizedPL }}</td>
|
||||
<td>{{ item.balance }}</td>
|
||||
<td>{{ item.currency }}</td>
|
||||
</tr>
|
||||
|
|
|
@ -26,10 +26,10 @@ class Profit(LoginRequiredMixin, OTPRequiredMixin, ObjectList):
|
|||
for account in accounts:
|
||||
try:
|
||||
details = account.client.get_account()
|
||||
pl = details["pl"]
|
||||
item = {
|
||||
"account": account,
|
||||
"pl": float(pl),
|
||||
"pl": float(details["pl"]),
|
||||
"unrealizedPL": float(details["unrealizedPL"]),
|
||||
"balance": details["balance"],
|
||||
"currency": details["currency"],
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue