From 2d44c2ad39fdd75091d0ef4ecef28eca4f5168da Mon Sep 17 00:00:00 2001 From: luxagraf Date: Mon, 30 Aug 2021 09:06:36 -0400 Subject: trad: added risk percentages to main options view --- app/trading/models.py | 8 ++++++++ app/trading/templates/trading/list.html | 13 ++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) (limited to 'app') diff --git a/app/trading/models.py b/app/trading/models.py index cbd58ed..80a67ed 100644 --- a/app/trading/models.py +++ b/app/trading/models.py @@ -286,7 +286,15 @@ class LuxOptionsTrade(models.Model): else: return round((((self.contract_price*self.number_contracts)*100)-((self.contract_close_price*self.number_contracts)*100)-self.fees), 2) + @property + def trade_risk_percent(self): + return round((self.risk_total/self.amount_invested)*100, 2); + @property + def portfolio_risk_percent(self): + return round((self.risk_total/10000)*100, 2); + + @property def realized_percent(self): if self.call_put == 0: diff --git a/app/trading/templates/trading/list.html b/app/trading/templates/trading/list.html index d27fd4f..38c7d46 100644 --- a/app/trading/templates/trading/list.html +++ b/app/trading/templates/trading/list.html @@ -80,15 +80,16 @@ Symbol Open Date Details + Delta Entry Price Stop Target - Delta Contract $ - # Contract Total Invested Risk per - Risk Total + $ Trade Risk + % Trade at Risk + % Portfolio at Risk Profit Goal Risk/Reward Price Calc @@ -101,20 +102,22 @@ {{object.date|date:"m-d-Y"}}
+ {{object.number_contracts}} {{object.expiration_date|date:"M j"}} {{object.days_until_expiration}} {{object.get_call_put_display|first}} ${{object.strike_price}}
+ {{object.delta}} ${{object.entry_price}} ${{object.stop_price}} ${{object.target_price}} - {{object.delta}} ${{object.contract_price}} - {{object.number_contracts}} ${{object.amount_invested}} ${{object.risk_per_contract}} ${{object.risk_total}} + ${{object.trade_risk_percent}} + ${{object.portfolio_risk_percent}} ${{object.profit_goal}} {{object.risk_reward}} -- cgit v1.2.3