Add trading journal and portfolio tracking

This commit is contained in:
kai
2026-09-09 19:01:30 +02:00
parent 1db3b008ec
commit c683bc74c0
24 changed files with 1043 additions and 8 deletions
+4
View File
@@ -0,0 +1,4 @@
{% extends 'base.html' %}{% block title %}{{ asset.name }} · Trading-Buch{% endblock %}{% block content %}
{% include '_trading_nav.html' %}<div class="page-heading"><div><h1>{{ asset.name }}</h1><p class="muted">{{ asset.ticker or 'Kein Ticker' }} · {{ asset_types[asset.asset_type] }}</p></div><a class="button" href="/trading/transactions/new?asset_id={{ asset.id }}">+ Transaktion eintragen</a></div>
{% if position %}<div class="kpi-grid">{% for label,value in [('Stückzahl',position.quantity|replace('.',',')),('Ø Einstand',position.average_cost|decimal(8)),('Investiertes Kapital',position.invested_capital|decimal),('Realisiert G/V',position.realized_profit_loss|decimal),('Summe Käufe inkl. Gebühren',position.total_buys|decimal),('Summe Verkäufe nach Gebühren',position.total_sells|decimal)] %}<article class="kpi"><h2>{{ label }}</h2><strong>{{ value }}</strong><small>{{ position.currency if label != 'Stückzahl' else 'Stück' }}</small></article>{% endfor %}</div><p class="muted">Erste Buchung: {{ position.first_transaction }} · Letzte Buchung: {{ position.last_transaction }} · {{ position.buy_count }} Käufe / {{ position.sell_count }} Verkäufe</p>{% else %}<p class="notice">Noch keine erfassten Trades. Es wurden keine Anfangsbestände oder Preise angenommen.</p>{% endif %}
<section class="panel"><h2>Vollständige Positionshistorie</h2>{% set show_balance = true %}{% include '_trading_entries.html' %}</section>{% endblock %}