mirror of
https://github.com/chrisnov-it/quantumbotx.git
synced 2026-07-28 03:07:53 +00:00
53ae5e8861
- Update `app.py` to include backtesting routes and improve blueprint registration. - Modify templates to include an active page parameter for navigation highlighting. - Remove unused `crypto_data.py` and `api_crypto.py`. - Add new backtesting-related files and templates.
50 lines
2.3 KiB
HTML
50 lines
2.3 KiB
HTML
<!-- templates/backtesting.html (Setelah Refactor) -->
|
|
{% extends "base.html" %}
|
|
|
|
{% block title %}Backtester{% endblock %}
|
|
|
|
{% block content %}
|
|
<h2 class="text-2xl font-bold text-gray-800 mb-4">Strategy Backtester</h2>
|
|
|
|
<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 %} |