summaryrefslogtreecommitdiff
path: root/app/trading
diff options
context:
space:
mode:
authorlxf <sng@luxagraf.net>2022-03-16 10:35:37 -0400
committerlxf <sng@luxagraf.net>2022-03-16 10:35:37 -0400
commit3602afb7d17d21ab9437ef3ac6443617f100cf08 (patch)
treec81e21e2dd387bb817bcfaa9cb5547832a2180bf /app/trading
parent35fcfdc28c2aa3d0872e20344e5949bbd798af5f (diff)
trad: reformatted the list view to make it easier to see monthly yearly
stats
Diffstat (limited to 'app/trading')
-rw-r--r--app/trading/templates/trading/list.html35
-rw-r--r--app/trading/views.py2
2 files changed, 34 insertions, 3 deletions
diff --git a/app/trading/templates/trading/list.html b/app/trading/templates/trading/list.html
index 0fdc03d..3063533 100644
--- a/app/trading/templates/trading/list.html
+++ b/app/trading/templates/trading/list.html
@@ -1,7 +1,7 @@
{% extends 'trading/base.html' %}
{% block content %}
- <h3>WON Options Trades</h3>
+ <h3>Options</h3>
<table class="options">
<thead>
<tr>
@@ -149,7 +149,7 @@
- <h3>Open Stock Trades</h3>
+ <h3>Stocks</h3>
<table>
<thead>
<tr>
@@ -221,6 +221,37 @@
</td>
</tr>
{% endfor %}
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>{{month}} P/L:</td>
+ <td>{{monthly_pl.pl__sum}}</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>YTD P/L:</td>
+ <td>{{year_pl.pl__sum}}</td>
+ </tr>
</table>
diff --git a/app/trading/views.py b/app/trading/views.py
index 86556f3..82904ca 100644
--- a/app/trading/views.py
+++ b/app/trading/views.py
@@ -31,7 +31,7 @@ class LuxTradeListView(PaginatedListView):
context['options_monthly_pl'] = LuxOptionPurchase.stats.get_month_pl()
context['options_year_pl'] = LuxOptionPurchase.stats.get_year_pl()
context['month'] = timezone.now().strftime('%h')
- context['luxoptions_purchases'] = LuxOptionPurchase.objects.all()
+ context['luxoptions_purchases'] = LuxOptionPurchase.objects.filter(close_date__range=(start_date, end_date))
return context
def get_queryset(self):