From 6a9c1dca17f2e4c620980dd7728c96e92ac4a584 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Wed, 4 Aug 2021 10:57:19 -0400 Subject: trad: added percent profit per trade to options --- app/trading/models.py | 2 ++ app/trading/templates/trading/list.html | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'app/trading') 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 @@ Risk Total Profit Goal Profit/Loss + Realized Percent Notes @@ -254,6 +255,7 @@ ${{object.risk_total}} ${{object.profit_goal}} {{object.pl}} + {{object.realized_percent}}% {% if object.notes %}
@@ -280,7 +282,7 @@ {{month}} P/L: - {{options_monthly_pl.pl__sum}} + ${{options_monthly_pl.pl__sum}} @@ -293,7 +295,7 @@ YTD P/L: - {{options_year_pl.pl__sum}} + ${{options_year_pl.pl__sum}} -- cgit v1.2.3-70-g09d2