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77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
<!DOCTYPE html>
<html lang="en" class="dark">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Análisis - QuantumTrading Nexus</title>
    <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/animejs/lib/anime.iife.min.js"></script>
    <script src="https://unpkg.com/feather-icons"></script>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
        
        * {
            font-family: 'Inter', sans-serif;
        }
        
        .dark {
            background: #0a0a0a;
        }
        
        .gradient-bg {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        
        .glass-effect {
            background: rgba(17, 25, 40, 0.75);
            backdrop-filter: blur(16px) saturate(180%);
            border: 1px solid rgba(255, 255, 255, 0.125);
        }
        
        .cyber-grid {
            background-image: 
                linear-gradient(rgba(102, 126, 234, 0.1) 1px, transparent 1px),
                linear-gradient(90deg, rgba(102, 126, 234, 0.1) 1px, transparent 1px);
            background-size: 50px 50px;
        }
        
        .pulse-animation {
            animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
        }
        
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }
        
        .hover-scale {
            transition: transform 0.3s ease;
        }
        
        .hover-scale:hover {
            transform: scale(1.05);
        }
        
        .text-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }
        
        ::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.1);
        }
        
        ::-webkit-scrollbar-thumb {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 4px;
        }
    </style>
</head>
<body class="bg-gray-950 text-gray-100 min-h-screen cyber-grid">
    <!-- Navigation Header -->
    <nav class="glass-effect fixed top-0 w-full z-50 px-6 py-4">
        <div class="max-w-7xl mx-auto flex justify-between items-center">
            <div class="flex items-center space-x-4">
                <div class="w-10 h-10 gradient-bg rounded-lg flex items-center justify-center">
                    <i data-feather="trending-up" class="w-6 h-6 text-white"></i>
                </div>
                <h1 class="text-2xl font-bold text-gradient">QuantumTrading Nexus</h1>
            </div>
            
            <div class="hidden md:flex items-center space-x-6">
                <a href="index.html" class="text-gray-300 hover:text-white transition-colors">Dashboard</a>
                <a href="signals.html" class="text-gray-300 hover:text-white transition-colors">Señales</a>
                <a href="strategies.html" class="text-gray-300 hover:text-white transition-colors">Estrategias</a>
                <a href="analytics.html" class="text-white">Análisis</a>
                <a href="settings.html" class="text-gray-300 hover:text-white transition-colors">Configuración</a>
            </div>
            
            <div class="flex items-center space-x-4">
                <button class="relative p-2 glass-effect rounded-lg hover-scale">
                    <i data-feather="bell" class="w-5 h-5"></i>
                    <span class="absolute top-0 right-0 w-2 h-2 bg-red-500 rounded-full pulse-animation"></span>
                </button>
                <button class="p-2 glass-effect rounded-lg hover-scale">
                    <i data-feather="settings" class="w-5 h-5"></i>
                </button>
                <div class="w-10 h-10 rounded-full bg-gradient-to-r from-purple-500 to-pink-500"></div>
            </div>
        </div>
    </nav>
    
    <!-- Main Content -->
    <main class="pt-20 px-6 pb-10">
        <div class="max-w-7xl mx-auto">
            <!-- Page Header -->
            <div class="flex flex-col md:flex-row justify-between items-start md:items-center mb-6">
                <div>
                    <h1 class="text-3xl font-bold mb-2">Centro de Análisis</h1>
                    <p class="text-gray-400">Análisis profundo y métricas de rendimiento</p>
                </div>
                <div class="flex space-x-3 mt-4 md:mt-0">
                    <button class="px-4 py-2 glass-effect rounded-lg hover-scale flex items-center space-x-2">
                        <i data-feather="calendar" class="w-4 h-4"></i>
                        <span>Período</span>
                    </button>
                    <button class="px-4 py-2 gradient-bg rounded-lg hover-scale flex items-center space-x-2">
                        <i data-feather="download" class="w-4 h-4"></i>
                        <span>Exportar</span>
                    </button>
                </div>
            </div>
            
            <!-- Key Performance Indicators -->
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
                <div class="glass-effect rounded-xl p-4">
                    <div class="flex items-center justify-between mb-2">
                        <p class="text-gray-400 text-sm">ROI Total</p>
                        <i data-feather="trending-up" class="w-4 h-4 text-green-400"></i>
                    </div>
                    <p class="text-2xl font-bold text-green-400">+147.3%</p>
                    <p class="text-xs text-gray-500 mt-1">vs. mes anterior: +12.4%</p>
                </div>
                
                <div class="glass-effect rounded-xl p-4">
                    <div class="flex items-center justify-between mb-2">
                        <p class="text-gray-400 text-sm">Win Rate</p>
                        <i data-feather="target" class="w-4 h-4 text-blue-400"></i>
                    </div>
                    <p class="text-2xl font-bold">89.2%</p>
                    <p class="text-xs text-gray-500 mt-1">vs. mes anterior: +2.1%</p>
                </div>
                
                <div class="glass-effect rounded-xl p-4">
                    <div class="flex items-center justify-between mb-2">
                        <p class="text-gray-400 text-sm">Profit Factor</p>
                        <i data-feather="bar-chart-2" class="w-4 h-4 text-purple-400"></i>
                    </div>
                    <p class="text-2xl font-bold">2.84</p>
                    <p class="text-xs text-gray-500 mt-1">vs. mes anterior: +0.3</p>
                </div>
                
                <div class="glass-effect rounded-xl p-4">
                    <div class="flex items-center justify-between mb-2">
                        <p class="text-gray-400 text-sm">Max DD</p>
                        <i data-feather="alert-triangle" class="w-4 h-4 text-orange-400"></i>
                    </div>
                    <p class="text-2xl font-bold text-red-400">-8.7%</p>
                    <p class="text-xs text-gray-500 mt-1">vs. mes anterior: -1.2%</p>
                </div>
            </div>
            
            <!-- Analytics Charts -->
            <div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6">
                <!-- Profit & Loss Chart -->
                <div class="glass-effect rounded-xl p-6">
                    <h2 class="text-xl font-semibold mb-4">Análisis P&L Diario</h2>
                    <canvas id="pnlChart"></canvas>
                </div>
                
                <!-- Win Rate Distribution -->
                <div class="glass-effect rounded-xl p-6">
                    <h2 class="text-xl font-semibold mb-4">Distribución de Éxito</h2>
                    <canvas id="winRateChart"></canvas>
                </div>
            </div>
            
            <!-- Risk Analysis -->
            <div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6">
                <!-- Drawdown Analysis -->
                <div class="glass-effect rounded-xl p-6">
                    <h2 class="text-lg font-semibold mb-4">Análisis de Drawdown</h2>
                    <div class="space-y-3">
                        <div>
                            <div class="flex justify-between text-sm mb-1">
                                <span class="text-gray-400">Drawdown Actual</span>
                                <span class="text-red-400">-2.3%</span>
                            </div>
                            <div class="w-full bg-gray-800 rounded-full h-2">
                                <div class="h-2 rounded-full bg-red-500" style="width: 23%"></div>
                            </div>
                        </div>
                        <div>
                            <div class="flex justify-between text-sm mb-1">
                                <span class="text-gray-400">Máximo Histórico</span>
                                <span class="text-orange-400">-8.7%</span>
                            </div>
                            <div class="w-full bg-gray-800 rounded-full h-2">
                                <div class="h-2 rounded-full bg-orange-500" style="width: 87%"></div>
                            </div>
                        </div>
                        <div>
                            <div class="flex justify-between text-sm mb-1">
                                <span class="text-gray-400">Promedio Mensual</span>
                                <span class="text-yellow-400">-4.2%</span>
                            </div>
                            <div class="w-full bg-gray-800 rounded-full h-2">
                                <div class="h-2 rounded-full bg-yellow-500" style="width: 42%"></div>
                            </div>
                        </div>
                    </div>
                    <div class="mt-4 p-3 bg-blue-500/10 rounded-lg">
                        <p class="text-sm text-blue-400">Recomendación: Considerar reducir tamaño de posición un 15%</p>
                    </div>
                </div>
                
                <!-- Risk Metrics -->
                <div class="glass-effect rounded-xl p-6">
                    <h2 class="text-lg font-semibold mb-4">Métricas de Riesgo</h2>
                    <div class="space-y-4">
                        <div class="flex items-center justify-between">
                            <span class="text-gray-400 text-sm">Sharpe Ratio</span>
                            <span class="font-semibold">2.84</span>
                        </div>
                        <div class="flex items-center justify-between">
                            <span class="text-gray-400 text-sm">Sortino Ratio</span>
                            <span class="font-semibold">3.92</span>
                        </div>
                        <div class="flex items-center justify-between">
                            <span class="text-gray-400 text-sm">Calmar Ratio</span>
                            <span class="font-semibold">1.76</span>
                        </div>
                        <div class="flex items-center justify-between">
                            <span class="text-gray-400 text-sm">VaR (95%)</span>
                            <span class="font-semibold text-red-400">-$2,847</span>
                        </div>
                        <div class="flex items-center justify-between">
                            <span class="text-gray-400 text-sm">CVaR (95%)</span>
                            <span class="font-semibold text-red-400">-$4,192</span>
                        </div>
                    </div>
                </div>
                
                <!-- Trade Statistics -->
                <div class="glass-effect rounded-xl p-6">
                    <h2 class="text-lg font-semibold mb-4">Estadísticas de Trading</h2>
                    <div class="space-y-4">
                        <div class="flex items-center justify-between">
                            <span class="text-gray-400 text-sm">Total de Trades</span>
                            <span class="font-semibold">1,247</span>
                        </div>
                        <div class="flex items-center justify-between">
                            <span class="text-gray-400 text-sm">Trades Ganadores</span>
                            <span class="font-semibold text-green-400">1,112</span>
                        </div>
                        <div class="flex items-center justify-between">
                            <span class="text-gray-400 text-sm">Trades Perdedores</span>
                            <span class="font-semibold text-red-400">135</span>
                        </div>
                        <div class="flex items-center justify-between">
                            <span class="text-gray-400 text-sm">Prom. Ganancia</span>
                            <span class="font-semibold text-green-400">+$324</span>
                        </div>
                        <div class="flex items-center justify-between">
                            <span class="text-gray-400 text-sm">Prom. Pérdida</span>
                            <span class="font-semibold text-red-400">-$187</span>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- Performance by Asset -->
            <div class="glass-effect rounded-xl p-6">
                <h2 class="text-xl font-semibold mb-6">Rendimiento por Activo</h2>
                <div class="overflow-x-auto">
                    <table class="w-full">
                        <thead>
                            <tr class="border-b border-gray-800">
                                <th class="text-left py-3 px-4 text-gray-400 font-medium">Activo</th>
                                <th class="text-left py-3 px-4 text-gray-400 font-medium">Trades</th>
                                <th class="text-left py-3 px-4 text-gray-400 font-medium">Win Rate</th>
                                <th class="text-left py-3 px-4 text-gray-400 font-medium">P&L Total</th>
                                <th class="text-left py-3 px-4 text-gray-400 font-medium">P&L Promedio</th>
                                <th class="text-left py-3 px-4 text-gray-400 font-medium">Factor</th>
                                <th class="text-left py-3 px-4 text-gray-400 font-medium">Tendencia</th>
                            </tr>
                        </thead>
                        <tbody id="assetPerformance">
                            <!-- Dynamic content -->
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </main>
    
    <script>
        // Initialize Feather Icons
        feather.replace();
        
        // P&L Chart
        const pnlCtx = document.getElementById('pnlChart').getContext('2d');
        new Chart(pnlCtx, {
            type: 'line',
            data: {
                labels: ['Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb', 'Dom'],
                datasets: [{
                    label: 'P&L Diario',
                    data: [1240, 890, 1560, -320, 2100, 1450, 980],
                    borderColor: '#10b981',
                    backgroundColor: 'rgba(16, 185, 129, 0.1)',
                    tension: 0.4,
                    fill: true
                }]
            },
            options: {
                responsive: true,
                plugins: {
                    legend: {
                        display: false
                    }
                },
                scales: {
                    x: {
                        grid: { color: 'rgba(255, 255, 255, 0.05)' },
                        ticks: { color: '#9ca3af' }
                    },
                    y: {
                        grid: { color: 'rgba(255, 255, 255, 0.05)' },
                        ticks: { 
                            color: '#9ca3af',
                            callback: function(value) {
                                return '$' + value.toLocaleString();
                            }
                        }
                    }
                }
            }
        });
        
        // Win Rate Chart
        const winRateCtx = document.getElementById('winRateChart').getContext('2d');
        new Chart(winRateCtx, {
            type: 'doughnut',
            data: {
                labels: ['Ganadores', 'Perdedores'],
                datasets: [{
                    data: [89.2, 10.8],
                    backgroundColor: ['#10b981', '#ef4444'],
                    borderWidth: 0
                }]
            },
            options: {
                responsive: true,
                plugins: {
                    legend: {
                        position: 'bottom',
                        labels: { color: '#9ca3af' }
                    }
                }
            }
        });
        
        // Asset Performance Data
        const assetData = [
            { asset: 'EURUSD', trades: 342, winRate: 91.2, pl: '+$12,450', avgPl: '+$364', factor: 3.24, trend: 'up' },
            { asset: 'GBPUSD', trades: 287, winRate: 88.7, pl: '+$9,820', avgPl: '+$342', factor: 2.87, trend: 'up' },
            { asset: 'USDJPY', trades: 256, winRate: 89.4, pl: '+$8,760', avgPl: '+$342', factor: 2.94, trend: 'stable' },
            { asset: 'AUDUSD', trades: 198, winRate: 87.3, pl: '+$5,430', avgPl: '+$274', factor: 2.31, trend: 'down' },
            { asset: 'USDCAD', trades: 164, winRate: 90.2, pl: '+$6,210', avgPl: '+$379', factor: 3.12, trend: 'up' }
        ];
        
        // Populate asset performance table
        const assetTable = document.getElementById('assetPerformance');
        assetData.forEach(asset => {
            const row = document.createElement('tr');
            row.className = 'border-b border-gray-800 hover:bg-gray-900/50 transition-colors';
            
            const trendIcon = asset.trend === 'up' ? 'trending-up text-green-400' : 
                            asset.trend === 'down' ? 'trending-down text-red-400' : 
                            'minus text-yellow-400';
            
            row.innerHTML = `
                <td class="py-3 px-4 font-semibold">${asset.asset}</td>
                <td class="py-3 px-4">${asset.trades}</td>
                <td class="py-3 px-4">
                    <div class="flex items-center space-x-2">
                        <div class="w-16 bg-gray-800 rounded-full h-2">
                            <div class="h-2 rounded-full bg-gradient-to-r from-purple-500 to-pink-500" style="width: ${asset.winRate}%"></div>
                        </div>
                        <span class="text-sm">${asset.winRate}%</span>
                    </div>
                </td>
                <td class="py-3 px-4 font-semibold text-green-400">${asset.pl}</td>
                <td class="py-3 px-4">${asset.avgPl}</td>
                <td class="py-3 px-4">${asset.factor}</td>
                <td class="py-3 px-4">
                    <i data-feather="${trendIcon.split(' ')[0]}" class="w-4 h-4 ${trendIcon.split(' ')[1]}"></i>
                </td>
            `;
            
            assetTable.appendChild(row);
        });
        
        // Re-initialize feather icons for dynamically added content
        feather.replace();
        
        // Add animations
        anime({
            targets: '.glass-effect',
            translateY: [20, 0],
            opacity: [0, 1],
            delay: anime.stagger(100),
            duration: 600,
            easing: 'easeOutQuad'
        });
    </script>
</body>
</html>