diff options
author | luxagraf <sng@luxagraf.net> | 2021-07-15 09:54:32 -0400 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2021-07-15 09:54:32 -0400 |
commit | 8af402161ed8cf7d67c5e44c36f5bad6e23c5cb2 (patch) | |
tree | 6bf41e0f2b9d399eb22e7aef060aea6fecb5313c /app/trading/models.py | |
parent | b54394f01539472fe80624da3c58216936d98456 (diff) |
trad: added some details to closed trades
Diffstat (limited to 'app/trading/models.py')
-rw-r--r-- | app/trading/models.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/trading/models.py b/app/trading/models.py index ae9d8e0..0b79c9e 100644 --- a/app/trading/models.py +++ b/app/trading/models.py @@ -136,11 +136,11 @@ class LuxTrade(models.Model): @property def realized_dollars(self): - return (self.close_price*self.shares)-(self.entry_price*self.shares) + return round((self.close_price*self.shares)-(self.entry_price*self.shares), 2) @property def realized_percent(self): - return (self.realized_dollars/self.amount_invested)*100 + return round((self.realized_dollars/self.amount_invested)*100, 2) def save(self, *args, **kwargs): if self.status == 0 and not self.open_date: |