summaryrefslogtreecommitdiff
path: root/app/trading
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2021-08-04 10:57:19 -0400
committerluxagraf <sng@luxagraf.net>2021-08-04 10:57:19 -0400
commit6a9c1dca17f2e4c620980dd7728c96e92ac4a584 (patch)
treec3351959a10129f8d39b5546cfa8d80c1954d806 /app/trading
parent01cff9a80da234b9da74eef97dea11aea0a8229a (diff)
trad: added percent profit per trade to options
Diffstat (limited to 'app/trading')
-rw-r--r--app/trading/models.py2
-rw-r--r--app/trading/templates/trading/list.html6
2 files changed, 6 insertions, 2 deletions
diff --git a/app/trading/models.py b/app/trading/models.py
index 97c82a6..678edd3 100644
--- a/app/trading/models.py
+++ b/app/trading/models.py
@@ -295,6 +295,8 @@ class LuxOptionsTrade(models.Model):
if self.status == 1 and not self.pl:
if self.call_put == 0:
self.pl = round(((self.contract_close_price*self.number_contracts)*100) - ((self.contract_price*self.number_contracts)*100), 2)
+ if self.notes:
+ self.notes_html = markdown_to_html(self.notes)
super(LuxOptionsTrade, self).save()
diff --git a/app/trading/templates/trading/list.html b/app/trading/templates/trading/list.html
index d00d599..d27fd4f 100644
--- a/app/trading/templates/trading/list.html
+++ b/app/trading/templates/trading/list.html
@@ -229,6 +229,7 @@
<th>Risk Total</th>
<th>Profit Goal</th>
<th>Profit/Loss</th>
+ <th>Realized Percent</th>
<th>Notes</th>
</tr>
</thead>
@@ -254,6 +255,7 @@
<td>${{object.risk_total}}</td>
<td>${{object.profit_goal}}</td>
<td>{{object.pl}}</td>
+ <td>{{object.realized_percent}}%</td>
<td class="notes">
{% if object.notes %}
<div class="wrapper">
@@ -280,7 +282,7 @@
<td></td>
<td></td>
<td>{{month}} P/L:</td>
- <td>{{options_monthly_pl.pl__sum}}</td>
+ <td>${{options_monthly_pl.pl__sum}}</td>
</tr>
<tr>
<td></td>
@@ -293,7 +295,7 @@
<td></td>
<td></td>
<td>YTD P/L:</td>
- <td>{{options_year_pl.pl__sum}}</td>
+ <td>${{options_year_pl.pl__sum}}</td>
</tr>
</table>