Alexo19's picture
finish the app
c11753d verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Live Demo - AlgoGenius TraderBot</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/lightweight-charts@3.7.0/dist/lightweight-charts.standalone.production.js"></script>
<style>
#chart-container {
height: 500px;
width: 100%;
}
.sidebar {
transition: all 0.3s ease;
}
.sidebar-collapsed {
width: 5rem;
}
.sidebar-collapsed .nav-text {
display: none;
}
.content {
transition: margin-left 0.3s ease;
}
.card-hover {
transition: all 0.3s ease;
}
.card-hover:hover {
transform: translateY(-5px);
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
</style>
</head>
<body class="bg-gray-50">
<div class="flex h-screen overflow-hidden">
<!-- Sidebar -->
<div class="sidebar bg-white w-64 border-r border-gray-200 flex flex-col">
<div class="flex items-center justify-center h-16 px-4 border-b border-gray-200">
<div class="flex items-center">
<i data-feather="activity" class="h-6 w-6 text-primary-500"></i>
<span class="ml-2 text-lg font-semibold text-gray-900">AlgoGenius</span>
</div>
</div>
<div class="flex-grow overflow-y-auto">
<nav class="px-2 py-4">
<div class="space-y-1">
<a href="dashboard.html" class="text-gray-600 hover:bg-gray-50 hover:text-gray-900 group flex items-center px-2 py-2 text-sm font-medium rounded-md">
<i data-feather="home" class="text-gray-400 group-hover:text-gray-500 mr-3 h-5 w-5"></i>
<span class="nav-text">Dashboard</span>
</a>
<a href="strategies.html" class="text-gray-600 hover:bg-gray-50 hover:text-gray-900 group flex items-center px-2 py-2 text-sm font-medium rounded-md">
<i data-feather="bar-chart-2" class="text-gray-400 group-hover:text-gray-500 mr-3 h-5 w-5"></i>
<span class="nav-text">Strategies</span>
</a>
<a href="telegram.html" class="text-gray-600 hover:bg-gray-50 hover:text-gray-900 group flex items-center px-2 py-2 text-sm font-medium rounded-md">
<i data-feather="download" class="text-gray-400 group-hover:text-gray-500 mr-3 h-5 w-5"></i>
<span class="nav-text">Telegram Feeds</span>
</a>
<a href="models.html" class="text-gray-600 hover:bg-gray-50 hover:text-gray-900 group flex items-center px-2 py-2 text-sm font-medium rounded-md">
<i data-feather="cpu" class="text-gray-400 group-hover:text-gray-500 mr-3 h-5 w-5"></i>
<span class="nav-text">AI Models</span>
</a>
<a href="backtesting.html" class="text-gray-600 hover:bg-gray-50 hover:text-gray-900 group flex items-center px-2 py-2 text-sm font-medium rounded-md">
<i data-feather="clock" class="text-gray-400 group-hover:text-gray-500 mr-3 h-5 w-5"></i>
<span class="nav-text">Backtesting</span>
</a>
<a href="settings.html" class="text-gray-600 hover:bg-gray-50 hover:text-gray-900 group flex items-center px-2 py-2 text-sm font-medium rounded-md">
<i data-feather="settings" class="text-gray-400 group-hover:text-gray-500 mr-3 h-5 w-5"></i>
<span class="nav-text">Settings</span>
</a>
</div>
</nav>
</div>
</div>
<!-- Main content -->
<div class="content flex-1 overflow-auto">
<!-- Top navigation -->
<header class="bg-white shadow-sm">
<div class="px-4 py-4 sm:px-6 lg:px-8 flex justify-between items-center">
<div class="flex items-center">
<button class="mr-4 text-gray-500 hover:text-gray-600 focus:outline-none">
<i data-feather="menu"></i>
</button>
<h1 class="text-lg font-semibold leading-6 text-gray-900">Live Demo</h1>
</div>
<div class="flex items-center space-x-4">
<div class="relative">
<select id="demo-symbol" class="block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm rounded-md">
<option>BTC/USD</option>
<option>ETH/USD</option>
<option>AAPL</option>
<option>TSLA</option>
<option>EUR/USD</option>
</select>
</div>
<div class="relative">
<select id="demo-timeframe" class="block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm rounded-md">
<option>1m</option>
<option>5m</option>
<option>15m</option>
<option>1h</option>
<option>4h</option>
<option>1d</option>
</select>
</div>
<button class="inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-primary-500 hover:bg-primary-600">
<i data-feather="play" class="mr-2 h-4 w-4"></i> Start Demo
</button>
</div>
</div>
</header>
<!-- Main content area -->
<main class="p-4 sm:p-6 lg:p-8">
<div class="bg-white shadow rounded-lg overflow-hidden mb-8">
<div class="px-4 py-5 sm:px-6 border-b border-gray-200">
<h3 class="text-lg leading-6 font-medium text-gray-900">Algorithmic Trading Simulation</h3>
<p class="mt-1 text-sm text-gray-500">Watch our AI trading bot in action with historical data</p>
</div>
<div class="px-4 py-5 sm:p-6">
<div id="chart-container"></div>
</div>
</div>
<div class="grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-4">
<!-- Stat Card 1 -->
<div class="card-hover bg-white overflow-hidden shadow rounded-lg">
<div class="px-4 py-5 sm:p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-indigo-500 rounded-md p-3">
<i data-feather="dollar-sign" class="h-6 w-6 text-white"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 truncate">Demo Balance</dt>
<dd class="flex items-baseline">
<div class="text-2xl font-semibold text-gray-900">$10,000.00</div>
</dd>
</dl>
</div>
</div>
</div>
</div>
<!-- Stat Card 2 -->
<div class="card-hover bg-white overflow-hidden shadow rounded-lg">
<div class="px-4 py-5 sm:p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-green-500 rounded-md p-3">
<i data-feather="trending-up" class="h-6 w-6 text-white"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 truncate">Profit/Loss</dt>
<dd class="flex items-baseline">
<div class="text-2xl font-semibold text-green-600">+$1,243.50</div>
<div class="ml-2 flex items-baseline text-sm font-semibold text-green-600">
<i data-feather="arrow-up" class="h-4 w-4"></i>
<span class="sr-only">Increased by</span>
12.4%
</div>
</dd>
</dl>
</div>
</div>
</div>
</div>
<!-- Stat Card 3 -->
<div class="card-hover bg-white overflow-hidden shadow rounded-lg">
<div class="px-4 py-5 sm:p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-blue-500 rounded-md p-3">
<i data-feather="check-circle" class="h-6 w-6 text-white"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 truncate">Win Rate</dt>
<dd class="flex items-baseline">
<div class="text-2xl font-semibold text-gray-900">68.3%</div>
</dd>
</dl>
</div>
</div>
</div>
</div>
<!-- Stat Card 4 -->
<div class="card-hover bg-white overflow-hidden shadow rounded-lg">
<div class="px-4 py-5 sm:p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-purple-500 rounded-md p-3">
<i data-feather="clock" class="h-6 w-6 text-white"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 truncate">Avg Trade Duration</dt>
<dd class="flex items-baseline">
<div class="text-2xl font-semibold text-gray-900">2.3h</div>
</dd>
</dl>
</div>
</div>
</div>
</div>
</div>
<!-- Trade Log -->
<div class="mt-8">
<div class="flex items-center justify-between mb-4">
<h2 class="text-lg font-medium text-gray-900">Trade Log</h2>
<a href="#" class="text-sm font-medium text-primary-600 hover:text-primary-500">View all</a>
</div>
<div class="card-hover bg-white shadow rounded-lg overflow-hidden">
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<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">Symbol</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Direction</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Entry</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Exit</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Profit</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Duration</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">BTC/USD</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Long</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">$42,356.78</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">$43,812.45</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-green-600 font-medium">+3.4%</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2h 15m</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">ETH/USD</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">Short</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">$3,245.67</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">$3,112.89</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-green-600 font-medium">+4.1%</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">1h 42m</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">AAPL</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Long</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">$178.34</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">$180.12</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-green-600 font-medium">+1.0%</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">3h 08m</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">TSLA</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">Short</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">$925.78</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">$912.45</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-green-600 font-medium">+1.4%</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">1h 55m</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</main>
</div>
</div>
<script>
// Initialize feather icons
feather.replace();
// Initialize chart
document.addEventListener('DOMContentLoaded', function() {
const chartContainer = document.getElementById('chart-container');
const chart = LightweightCharts.createChart(chartContainer, {
width: chartContainer.clientWidth,
height: 500,
layout: {
backgroundColor: '#ffffff',
textColor: '#6B7280',
},
grid: {
vertLines: {
color: '#E5E7EB',
},
horzLines: {
color: '#E5E7EB',
},
},
crosshair: {
mode: LightweightCharts.CrosshairMode.Normal,
},
rightPriceScale: {
borderColor: '#E5E7EB',
},
timeScale: {
borderColor: '#E5E7EB',
},
});
const candleSeries = chart.addCandlestickSeries({
upColor: '#10B981',
downColor: '#EF4444',
borderDownColor: '#EF4444',
borderUpColor: '#10B981',
wickDownColor: '#EF4444',
wickUpColor: '#10B981',
});
// Sample data
const data = [
{ time: '2023-01-01', open: 100, high: 105, low: 95, close: 103 },
{ time: '2023-01-02', open: 103, high: 108, low: 101, close: 106 },
{ time: '2023-01-03', open: 106, high: 110, low: 98, close: 99 },
{ time: '2023-01-04', open: 99, high: 103, low: 96, close: 101 },
{ time: '2023-01-05', open: 101, high: 109, low: 100, close: 107 },
{ time: '2023-01-06', open: 107, high: 112, low: 104, close: 110 },
{ time: '2023-01-07', open: 110, high: 115, low: 108, close: 112 },
{ time: '2023-01-08', open: 112, high: 117, low: 110, close: 115 },
{ time: '2023-01-09', open: 115, high: 120, low: 112, close: 118 },
{ time: '2023-01-10', open: 118, high: 124, low: 116, close: 122 },
];
candleSeries.setData(data);
// Add markers for trades
const markers = [
{
time: '2023-01-02',
position: 'belowBar',
color: '#10B981',
shape: 'arrowUp',
text: 'Buy',
},
{
time: '2023-01-05',
position: 'aboveBar',
color: '#EF4444',
shape: 'arrowDown',
text: 'Sell',
},
{
time: '2023-01-07',
position: 'belowBar',
color: '#10B981',
shape: 'arrowUp',
text: 'Buy',
},
];
candleSeries.setMarkers(markers);
// Handle window resize
window.addEventListener('resize', function() {
chart.applyOptions({ width: chartContainer.clientWidth });
});
// Collapse sidebar functionality
const sidebar = document.querySelector('.sidebar');
const toggleBtn = document.querySelector('header button');
toggleBtn.addEventListener('click', function() {
sidebar.classList.toggle('sidebar-collapsed');
document.querySelector('.content').classList.toggle('ml-20');
document.querySelector('.content').classList.toggle('ml-64');
});
});
</script>
</body>
</html>