mirror of
https://github.com/chrisnov-it/quantumbotx.git
synced 2026-07-28 03:07:53 +00:00
0346b0d632
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.
55 lines
2.6 KiB
HTML
55 lines
2.6 KiB
HTML
<!-- templates/backtesting.html (Setelah Refactor) -->
|
|
{% extends "base.html" %}
|
|
|
|
{% block title %}Backtester{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="flex justify-between items-center mb-4">
|
|
<h2 class="text-2xl font-bold text-gray-800">Strategy Backtester</h2>
|
|
<a href="{{ url_for('backtest_history_page') }}" class="bg-gray-200 text-gray-800 py-2 px-4 rounded-lg font-medium hover:bg-gray-300">
|
|
<i class="fas fa-history mr-2"></i>Lihat Riwayat
|
|
</a>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
|
<!-- Kolom Konfigurasi -->
|
|
<div class="lg:col-span-1 bg-white p-6 rounded-lg shadow">
|
|
<form id="backtest-form">
|
|
<div class="space-y-4">
|
|
<div>
|
|
<label for="strategy-select" class="block text-sm font-medium text-gray-700">Pilih Strategi</label>
|
|
<select id="strategy-select" name="strategy" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm"></select>
|
|
</div>
|
|
<div>
|
|
<label for="data-file" class="block text-sm font-medium text-gray-700">Unggah Data Historis (CSV)</label>
|
|
<input type="file" id="data-file" name="file" accept=".csv" class="mt-1 block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100" required>
|
|
</div>
|
|
<div id="params-container" class="space-y-4 pt-4 border-t">
|
|
<!-- Parameter akan dimuat di sini -->
|
|
</div>
|
|
<button type="submit" id="run-backtest-btn" class="w-full bg-blue-600 text-white py-2 px-4 rounded-lg font-medium hover:bg-blue-700">
|
|
Jalankan Backtest
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Kolom Hasil -->
|
|
<div id="results-container" class="lg:col-span-2 bg-white p-6 rounded-lg shadow hidden">
|
|
<h3 class="text-xl font-bold mb-4">Hasil Backtest</h3>
|
|
<div id="results-summary" class="grid grid-cols-2 md:grid-cols-3 gap-4 mb-6"></div>
|
|
<div class="mb-6">
|
|
<canvas id="equity-chart"></canvas>
|
|
</div>
|
|
<div id="results-log"></div>
|
|
</div>
|
|
<div id="loading-spinner" class="lg:col-span-2 flex items-center justify-center hidden">
|
|
<i class="fas fa-spinner fa-spin text-blue-500 text-4xl"></i>
|
|
<p class="ml-4 text-gray-600">Menjalankan simulasi...</p>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
<script src="{{ url_for('static', filename='js/backtesting.js') }}"></script>
|
|
{% endblock %} |