From 7ef866d37fa35aadb7ead8928b904395b49d52f8 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Tue, 27 Jul 2021 11:50:34 -0400 Subject: trad: added a table of options history --- app/trading/templates/trading/list.html | 59 +++++++++++++++++++++++++++++++++ app/trading/views.py | 1 + 2 files changed, 60 insertions(+) (limited to 'app/trading') diff --git a/app/trading/templates/trading/list.html b/app/trading/templates/trading/list.html index 60ab941..f2f7e26 100644 --- a/app/trading/templates/trading/list.html +++ b/app/trading/templates/trading/list.html @@ -196,6 +196,65 @@ {{monthly_pl.pl__sum}} + + +

Options History

+ + + + + + + + + + + + + + + + + + + + + {% for object in options_trades_closed %} + + + + + + + + + + + + + + + + {%if object.status == 2%}{% endif %} + + {% endfor %} +
SymbolOpen/Close DateDetailsEntry PriceStopTargetDeltaContract $# ContractContract Close $Total InvestedRisk TotalProfit GoalProfit/LossNotes
{{object.symbol}}{{object.date|date:"m-d-Y"}} - {{object.close_date|date:"m-d-Y"}} +
+ {{object.expiration_date|date:"M j"}} + {{object.days_until_expiration}} + {{object.get_call_put_display|first}} + ${{object.strike_price}} +
+
${{object.entry_price}}${{object.stop_price}}${{object.target_price}}{{object.delta}}${{object.contract_price}}{{object.number_contracts}}${{object.contract_close_price}}${{object.amount_invested}}${{object.risk_total}}${{object.profit_goal}}{{object.pl}} + {% if object.notes %} +
+ {{object.notes_html|safe}} +
+ {% endif %} +
+ +
+ {% endblock %} diff --git a/app/trading/views.py b/app/trading/views.py index 4f2c1d6..9922bd5 100644 --- a/app/trading/views.py +++ b/app/trading/views.py @@ -15,6 +15,7 @@ class LuxTradeListView(PaginatedListView): context['open_trades'] = LuxTrade.objects.filter(status=0) context['watch_trades'] = LuxTrade.objects.filter(status=2) context['options_trades'] = LuxOptionsTrade.objects.filter(status__in=[0,2]) + context['options_trades_closed'] = LuxOptionsTrade.objects.filter(status=1) context['monthly_pl'] = LuxTrade.stats.get_month_pl() context['month'] = datetime.now().strftime('%h') return context -- cgit v1.2.3-70-g09d2