Files
quantumbotx/templates/portfolio.html
T
Reynov Christian 0346b0d632 Refactor and update forex and stock modal handling in JavaScript
Refactor the JavaScript code to use a single modal for both forex and stock profiles. Update error handling to display server error messages. Remove unused app.py and fetch.py files. Adjust various routes and strategies for consistency.
2025-08-08 10:39:03 +08:00

55 lines
2.7 KiB
HTML

<!-- templates/portfolio.html -->
{% extends "base.html" %}
{% block title %}Portfolio Real-Time{% endblock %}
{% block content %}
<div class="flex justify-between items-center mb-6">
<div>
<h2 class="text-2xl font-bold text-gray-800">Portfolio Real-Time</h2>
<p class="text-gray-600">Posisi trading yang sedang terbuka di akun MetaTrader 5.</p>
</div>
<div id="portfolio-summary" class="text-right">
<!-- Summary akan dimuat di sini -->
</div>
</div>
<!-- Grid untuk menampung dua chart -->
<div class="grid grid-cols-1 lg:grid-cols-5 gap-6 mb-6">
<!-- Chart P/L (lebih lebar) -->
<div class="lg:col-span-3 bg-white rounded-lg shadow p-4">
<h3 class="text-lg font-semibold text-gray-800 mb-2">Grafik Profit/Loss Terbuka (Real-Time)</h3>
<div style="height: 250px;"><canvas id="pnlChart"></canvas></div>
</div>
<!-- Chart Alokasi Aset (lebih kecil) -->
<div class="lg:col-span-2 bg-white rounded-lg shadow p-4">
<h3 class="text-lg font-semibold text-gray-800 mb-2">Alokasi Aset</h3>
<div style="height: 250px;"><canvas id="assetAllocationChart"></canvas></div>
</div>
</div>
<!-- Tabel Posisi Terbuka -->
<table class="min-w-full bg-white rounded-lg shadow overflow-hidden">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Simbol</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Tipe</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Volume</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Harga Buka</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Profit/Loss</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Magic Number</th>
</tr>
</thead>
<tbody id="portfolio-table-body" class="bg-white divide-y divide-gray-200">
<tr><td colspan="6" class="p-4 text-center text-gray-500">Memuat posisi terbuka...</td></tr>
</tbody>
</table>
{% endblock %}
{% block scripts %}
<!-- Library Chart.js utama, adapter, dan skrip halaman dimuat bersamaan -->
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chartjs-adapter-date-fns/dist/chartjs-adapter-date-fns.bundle.min.js"></script>
<script src="{{ url_for('static', filename='js/portfolio.js') }}"></script>
{% endblock %}