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