Spaces:
Running
Running
Add 2 files
Browse files- README.md +7 -5
- index.html +1474 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: basic-frame-trade-bot
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: gray
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,1474 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>QuantumFX AI - Advanced Forex Trading Bot</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
| 10 |
+
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
|
| 11 |
+
<style>
|
| 12 |
+
.gradient-bg {
|
| 13 |
+
background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
|
| 14 |
+
}
|
| 15 |
+
.card-glow:hover {
|
| 16 |
+
box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
|
| 17 |
+
}
|
| 18 |
+
.signal-buy {
|
| 19 |
+
border-left: 4px solid #10b981;
|
| 20 |
+
}
|
| 21 |
+
.signal-sell {
|
| 22 |
+
border-left: 4px solid #ef4444;
|
| 23 |
+
}
|
| 24 |
+
.signal-neutral {
|
| 25 |
+
border-left: 4px solid #f59e0b;
|
| 26 |
+
}
|
| 27 |
+
.blink {
|
| 28 |
+
animation: blink 1s infinite;
|
| 29 |
+
}
|
| 30 |
+
@keyframes blink {
|
| 31 |
+
0% { opacity: 1; }
|
| 32 |
+
50% { opacity: 0.5; }
|
| 33 |
+
100% { opacity: 1; }
|
| 34 |
+
}
|
| 35 |
+
.news-ticker {
|
| 36 |
+
white-space: nowrap;
|
| 37 |
+
animation: ticker 30s linear infinite;
|
| 38 |
+
}
|
| 39 |
+
@keyframes ticker {
|
| 40 |
+
0% { transform: translateX(100%); }
|
| 41 |
+
100% { transform: translateX(-100%); }
|
| 42 |
+
}
|
| 43 |
+
.loading-spinner {
|
| 44 |
+
border: 3px solid rgba(255, 255, 255, 0.3);
|
| 45 |
+
border-radius: 50%;
|
| 46 |
+
border-top: 3px solid #3b82f6;
|
| 47 |
+
width: 20px;
|
| 48 |
+
height: 20px;
|
| 49 |
+
animation: spin 1s linear infinite;
|
| 50 |
+
}
|
| 51 |
+
@keyframes spin {
|
| 52 |
+
0% { transform: rotate(0deg); }
|
| 53 |
+
100% { transform: rotate(360deg); }
|
| 54 |
+
}
|
| 55 |
+
</style>
|
| 56 |
+
</head>
|
| 57 |
+
<body class="bg-gray-900 text-gray-100 font-sans">
|
| 58 |
+
<div class="min-h-screen flex flex-col">
|
| 59 |
+
<!-- Header -->
|
| 60 |
+
<header class="gradient-bg py-4 px-6 shadow-lg">
|
| 61 |
+
<div class="flex justify-between items-center">
|
| 62 |
+
<div class="flex items-center space-x-3">
|
| 63 |
+
<i class="fas fa-robot text-blue-400 text-2xl"></i>
|
| 64 |
+
<h1 class="text-xl font-bold">Quantum<span class="text-blue-400">FX</span> AI</h1>
|
| 65 |
+
</div>
|
| 66 |
+
<div class="flex items-center space-x-4">
|
| 67 |
+
<div class="flex items-center space-x-2">
|
| 68 |
+
<span class="h-3 w-3 rounded-full bg-green-500 animate-pulse"></span>
|
| 69 |
+
<span id="connection-status">Connecting...</span>
|
| 70 |
+
</div>
|
| 71 |
+
<div id="live-status" class="bg-gray-600 px-3 py-1 rounded-full text-sm">
|
| 72 |
+
<span>OFFLINE</span>
|
| 73 |
+
</div>
|
| 74 |
+
<button class="bg-blue-600 hover:bg-blue-700 px-4 py-1 rounded-md text-sm">
|
| 75 |
+
<i class="fas fa-cog mr-1"></i> Settings
|
| 76 |
+
</button>
|
| 77 |
+
</div>
|
| 78 |
+
</div>
|
| 79 |
+
</header>
|
| 80 |
+
|
| 81 |
+
<!-- News Ticker -->
|
| 82 |
+
<div class="bg-gray-800 py-2 px-4 overflow-hidden">
|
| 83 |
+
<div class="flex items-center">
|
| 84 |
+
<span class="bg-red-600 px-2 py-1 rounded text-xs mr-3">LIVE NEWS</span>
|
| 85 |
+
<div class="overflow-hidden w-full">
|
| 86 |
+
<div id="news-ticker" class="news-ticker">
|
| 87 |
+
<span>Loading market news...</span>
|
| 88 |
+
</div>
|
| 89 |
+
</div>
|
| 90 |
+
</div>
|
| 91 |
+
</div>
|
| 92 |
+
|
| 93 |
+
<!-- Main Content -->
|
| 94 |
+
<main class="flex-1 p-6 grid grid-cols-1 lg:grid-cols-4 gap-6">
|
| 95 |
+
<!-- Market Overview -->
|
| 96 |
+
<div class="lg:col-span-4 bg-gray-800 rounded-xl p-4 shadow-lg">
|
| 97 |
+
<div class="flex justify-between items-center mb-4">
|
| 98 |
+
<h2 class="text-lg font-semibold">Market Overview</h2>
|
| 99 |
+
<div class="flex space-x-2">
|
| 100 |
+
<button class="bg-blue-600 hover:bg-blue-700 px-3 py-1 rounded text-sm">Forex</button>
|
| 101 |
+
<button class="bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded text-sm">Indices</button>
|
| 102 |
+
<button class="bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded text-sm">Commodities</button>
|
| 103 |
+
</div>
|
| 104 |
+
</div>
|
| 105 |
+
<div class="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-8 gap-3" id="market-overview">
|
| 106 |
+
<!-- Market data will be loaded here -->
|
| 107 |
+
<div class="flex items-center justify-center h-32">
|
| 108 |
+
<div class="loading-spinner"></div>
|
| 109 |
+
</div>
|
| 110 |
+
</div>
|
| 111 |
+
</div>
|
| 112 |
+
|
| 113 |
+
<!-- Main Chart -->
|
| 114 |
+
<div class="lg:col-span-3 bg-gray-800 rounded-xl p-4 shadow-lg">
|
| 115 |
+
<div class="flex justify-between items-center mb-4">
|
| 116 |
+
<div class="flex items-center space-x-4">
|
| 117 |
+
<h2 id="main-chart-title" class="text-lg font-semibold">EUR/USD</h2>
|
| 118 |
+
<div class="flex space-x-2">
|
| 119 |
+
<button class="bg-blue-600 hover:bg-blue-700 px-3 py-1 rounded text-sm" onclick="changeTimeframe('1h')">1H</button>
|
| 120 |
+
<button class="bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded text-sm" onclick="changeTimeframe('4h')">4H</button>
|
| 121 |
+
<button class="bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded text-sm" onclick="changeTimeframe('1d')">D</button>
|
| 122 |
+
<button class="bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded text-sm" onclick="changeTimeframe('1w')">W</button>
|
| 123 |
+
</div>
|
| 124 |
+
</div>
|
| 125 |
+
<div class="flex items-center space-x-3">
|
| 126 |
+
<div class="flex items-center space-x-1">
|
| 127 |
+
<i class="fas fa-bolt text-yellow-400"></i>
|
| 128 |
+
<span class="text-sm">AI Confidence: <span id="ai-confidence">87%</span></span>
|
| 129 |
+
</div>
|
| 130 |
+
<div id="signal-strength" class="bg-green-600 px-2 py-1 rounded-full text-xs">
|
| 131 |
+
<span>STRONG BUY</span>
|
| 132 |
+
</div>
|
| 133 |
+
</div>
|
| 134 |
+
</div>
|
| 135 |
+
<div class="h-96">
|
| 136 |
+
<canvas id="mainChart"></canvas>
|
| 137 |
+
</div>
|
| 138 |
+
<div class="mt-4 grid grid-cols-4 gap-3">
|
| 139 |
+
<div class="bg-gray-700 rounded-lg p-3">
|
| 140 |
+
<p class="text-sm text-gray-400">Current Price</p>
|
| 141 |
+
<p id="current-price" class="text-lg font-bold">1.0985</p>
|
| 142 |
+
</div>
|
| 143 |
+
<div class="bg-gray-700 rounded-lg p-3">
|
| 144 |
+
<p class="text-sm text-gray-400">Daily High</p>
|
| 145 |
+
<p id="daily-high" class="text-lg font-bold">1.1023</p>
|
| 146 |
+
</div>
|
| 147 |
+
<div class="bg-gray-700 rounded-lg p-3">
|
| 148 |
+
<p class="text-sm text-gray-400">Daily Low</p>
|
| 149 |
+
<p id="daily-low" class="text-lg font-bold">1.0957</p>
|
| 150 |
+
</div>
|
| 151 |
+
<div class="bg-gray-700 rounded-lg p-3">
|
| 152 |
+
<p class="text-sm text-gray-400">24h Change</p>
|
| 153 |
+
<p id="daily-change" class="text-lg font-bold text-green-500">+0.42%</p>
|
| 154 |
+
</div>
|
| 155 |
+
</div>
|
| 156 |
+
</div>
|
| 157 |
+
|
| 158 |
+
<!-- Trading Signals -->
|
| 159 |
+
<div class="lg:col-span-1 bg-gray-800 rounded-xl p-4 shadow-lg">
|
| 160 |
+
<div class="flex justify-between items-center mb-4">
|
| 161 |
+
<h2 class="text-lg font-semibold">Trading Signals</h2>
|
| 162 |
+
<div class="text-xs text-gray-400">Updated: <span id="signals-updated">Just now</span></div>
|
| 163 |
+
</div>
|
| 164 |
+
<div id="trading-signals" class="space-y-3 max-h-[500px] overflow-y-auto pr-2">
|
| 165 |
+
<!-- Signals will be loaded here -->
|
| 166 |
+
<div class="flex items-center justify-center h-32">
|
| 167 |
+
<div class="loading-spinner"></div>
|
| 168 |
+
</div>
|
| 169 |
+
</div>
|
| 170 |
+
</div>
|
| 171 |
+
|
| 172 |
+
<!-- Technical Analysis -->
|
| 173 |
+
<div class="lg:col-span-2 bg-gray-800 rounded-xl p-4 shadow-lg">
|
| 174 |
+
<h2 class="text-lg font-semibold mb-4">Technical Analysis</h2>
|
| 175 |
+
<div class="grid grid-cols-2 gap-4" id="technical-analysis">
|
| 176 |
+
<!-- Analysis will be loaded here -->
|
| 177 |
+
<div class="flex items-center justify-center h-32">
|
| 178 |
+
<div class="loading-spinner"></div>
|
| 179 |
+
</div>
|
| 180 |
+
</div>
|
| 181 |
+
</div>
|
| 182 |
+
|
| 183 |
+
<!-- Fundamental Analysis -->
|
| 184 |
+
<div class="lg:col-span-1 bg-gray-800 rounded-xl p-4 shadow-lg">
|
| 185 |
+
<h2 class="text-lg font-semibold mb-4">Fundamental Analysis</h2>
|
| 186 |
+
<div class="space-y-4" id="fundamental-analysis">
|
| 187 |
+
<!-- Analysis will be loaded here -->
|
| 188 |
+
<div class="flex items-center justify-center h-32">
|
| 189 |
+
<div class="loading-spinner"></div>
|
| 190 |
+
</div>
|
| 191 |
+
</div>
|
| 192 |
+
</div>
|
| 193 |
+
|
| 194 |
+
<!-- Risk Management -->
|
| 195 |
+
<div class="lg:col-span-1 bg-gray-800 rounded-xl p-4 shadow-lg">
|
| 196 |
+
<h2 class="text-lg font-semibold mb-4">Risk Management</h2>
|
| 197 |
+
<div class="space-y-4" id="risk-management">
|
| 198 |
+
<!-- Risk data will be loaded here -->
|
| 199 |
+
<div class="flex items-center justify-center h-32">
|
| 200 |
+
<div class="loading-spinner"></div>
|
| 201 |
+
</div>
|
| 202 |
+
</div>
|
| 203 |
+
</div>
|
| 204 |
+
|
| 205 |
+
<!-- Trade Execution -->
|
| 206 |
+
<div class="lg:col-span-1 bg-gray-800 rounded-xl p-4 shadow-lg">
|
| 207 |
+
<h2 class="text-lg font-semibold mb-4">Trade Execution</h2>
|
| 208 |
+
<div class="space-y-4" id="trade-execution">
|
| 209 |
+
<!-- Execution will be loaded here -->
|
| 210 |
+
<div class="flex items-center justify-center h-32">
|
| 211 |
+
<div class="loading-spinner"></div>
|
| 212 |
+
</div>
|
| 213 |
+
</div>
|
| 214 |
+
</div>
|
| 215 |
+
|
| 216 |
+
<!-- AI Insights -->
|
| 217 |
+
<div class="lg:col-span-2 bg-gray-800 rounded-xl p-4 shadow-lg">
|
| 218 |
+
<h2 class="text-lg font-semibold mb-4">AI Insights</h2>
|
| 219 |
+
<div id="ai-insights">
|
| 220 |
+
<!-- Insights will be loaded here -->
|
| 221 |
+
<div class="flex items-center justify-center h-32">
|
| 222 |
+
<div class="loading-spinner"></div>
|
| 223 |
+
</div>
|
| 224 |
+
</div>
|
| 225 |
+
</div>
|
| 226 |
+
</main>
|
| 227 |
+
|
| 228 |
+
<!-- Footer -->
|
| 229 |
+
<footer class="bg-gray-800 py-3 px-6 border-t border-gray-700">
|
| 230 |
+
<div class="flex justify-between items-center text-sm text-gray-400">
|
| 231 |
+
<div>
|
| 232 |
+
<span>QuantumFX AI v2.4.1 | </span>
|
| 233 |
+
<span>Last Update: <span id="last-update" class="text-blue-400">Just now</span></span>
|
| 234 |
+
</div>
|
| 235 |
+
<div class="flex space-x-4">
|
| 236 |
+
<span>Server: NY4 <i id="server-status" class="fas fa-circle text-gray-500 ml-1"></i></span>
|
| 237 |
+
<span>Ping: <span id="ping">--</span>ms</span>
|
| 238 |
+
<span>CPU: <span id="cpu">--</span>%</span>
|
| 239 |
+
<span>RAM: <span id="ram">--</span>%</span>
|
| 240 |
+
</div>
|
| 241 |
+
</div>
|
| 242 |
+
</footer>
|
| 243 |
+
</div>
|
| 244 |
+
|
| 245 |
+
<script>
|
| 246 |
+
// API Configuration
|
| 247 |
+
const API_KEY = 'YOUR_FOREX_API_KEY'; // Replace with your actual API key
|
| 248 |
+
const BASE_URL = 'https://api.forexapi.com/v1';
|
| 249 |
+
|
| 250 |
+
// Current selected pair and timeframe
|
| 251 |
+
let currentPair = 'EURUSD';
|
| 252 |
+
let currentTimeframe = '1h';
|
| 253 |
+
|
| 254 |
+
// Chart instances
|
| 255 |
+
let mainChart;
|
| 256 |
+
let allocationChart;
|
| 257 |
+
let miniCharts = {};
|
| 258 |
+
|
| 259 |
+
// Initialize the dashboard
|
| 260 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 261 |
+
// Update connection status
|
| 262 |
+
updateConnectionStatus();
|
| 263 |
+
|
| 264 |
+
// Load initial data
|
| 265 |
+
loadMarketData();
|
| 266 |
+
loadMainChartData();
|
| 267 |
+
loadTradingSignals();
|
| 268 |
+
loadTechnicalAnalysis();
|
| 269 |
+
loadFundamentalAnalysis();
|
| 270 |
+
loadRiskManagement();
|
| 271 |
+
loadTradeExecution();
|
| 272 |
+
loadAIInsights();
|
| 273 |
+
|
| 274 |
+
// Set up periodic updates
|
| 275 |
+
setInterval(updateDashboard, 30000); // Update every 30 seconds
|
| 276 |
+
setInterval(updatePerformanceMetrics, 5000); // Update performance metrics every 5 seconds
|
| 277 |
+
});
|
| 278 |
+
|
| 279 |
+
// Update connection status
|
| 280 |
+
async function updateConnectionStatus() {
|
| 281 |
+
try {
|
| 282 |
+
document.getElementById('connection-status').textContent = 'Connecting...';
|
| 283 |
+
|
| 284 |
+
// Simulate API connection check
|
| 285 |
+
setTimeout(() => {
|
| 286 |
+
document.getElementById('connection-status').textContent = 'Connected';
|
| 287 |
+
document.getElementById('live-status').className = 'bg-green-600 px-3 py-1 rounded-full text-sm';
|
| 288 |
+
document.getElementById('live-status').innerHTML = '<span>LIVE</span>';
|
| 289 |
+
document.getElementById('server-status').className = 'fas fa-circle text-green-500 ml-1';
|
| 290 |
+
}, 1500);
|
| 291 |
+
} catch (error) {
|
| 292 |
+
console.error('Connection error:', error);
|
| 293 |
+
document.getElementById('connection-status').textContent = 'Disconnected';
|
| 294 |
+
document.getElementById('live-status').className = 'bg-red-600 px-3 py-1 rounded-full text-sm';
|
| 295 |
+
document.getElementById('live-status').innerHTML = '<span>OFFLINE</span>';
|
| 296 |
+
document.getElementById('server-status').className = 'fas fa-circle text-red-500 ml-1';
|
| 297 |
+
}
|
| 298 |
+
}
|
| 299 |
+
|
| 300 |
+
// Update performance metrics
|
| 301 |
+
function updatePerformanceMetrics() {
|
| 302 |
+
document.getElementById('ping').textContent = Math.floor(Math.random() * 20) + 10;
|
| 303 |
+
document.getElementById('cpu').textContent = Math.floor(Math.random() * 10) + 5;
|
| 304 |
+
document.getElementById('ram').textContent = Math.floor(Math.random() * 20) + 20;
|
| 305 |
+
}
|
| 306 |
+
|
| 307 |
+
// Change timeframe for main chart
|
| 308 |
+
function changeTimeframe(timeframe) {
|
| 309 |
+
currentTimeframe = timeframe;
|
| 310 |
+
loadMainChartData();
|
| 311 |
+
|
| 312 |
+
// Update button styles
|
| 313 |
+
document.querySelectorAll('#main-chart-title ~ div button').forEach(btn => {
|
| 314 |
+
btn.className = 'bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded text-sm';
|
| 315 |
+
});
|
| 316 |
+
document.querySelector(`button[onclick="changeTimeframe('${timeframe}')"]`).className =
|
| 317 |
+
'bg-blue-600 hover:bg-blue-700 px-3 py-1 rounded text-sm';
|
| 318 |
+
}
|
| 319 |
+
|
| 320 |
+
// Load market data for overview
|
| 321 |
+
async function loadMarketData() {
|
| 322 |
+
try {
|
| 323 |
+
// In a real app, you would fetch from ForexAPI
|
| 324 |
+
// const response = await axios.get(`${BASE_URL}/market?api_key=${API_KEY}`);
|
| 325 |
+
|
| 326 |
+
// Simulated response with realistic data
|
| 327 |
+
const simulatedResponse = {
|
| 328 |
+
data: {
|
| 329 |
+
EURUSD: { price: 1.0985, change: 0.42, high: 1.1023, low: 1.0957 },
|
| 330 |
+
GBPUSD: { price: 1.2642, change: -0.18, high: 1.2678, low: 1.2610 },
|
| 331 |
+
USDJPY: { price: 138.72, change: 0.65, high: 138.95, low: 138.10 },
|
| 332 |
+
AUDUSD: { price: 0.6714, change: -0.31, high: 0.6732, low: 0.6705 },
|
| 333 |
+
USDCAD: { price: 1.3428, change: 0.27, high: 1.3440, low: 1.3405 },
|
| 334 |
+
XAUUSD: { price: 1978.42, change: 1.12, high: 1982.50, low: 1970.30 },
|
| 335 |
+
OILUSD: { price: 72.56, change: -2.35, high: 73.80, low: 72.20 },
|
| 336 |
+
BTCUSD: { price: 27345, change: 3.78, high: 27500, low: 27020 }
|
| 337 |
+
}
|
| 338 |
+
};
|
| 339 |
+
|
| 340 |
+
const marketData = simulatedResponse.data;
|
| 341 |
+
let marketOverviewHTML = '';
|
| 342 |
+
|
| 343 |
+
// Generate market cards
|
| 344 |
+
for (const [pair, data] of Object.entries(marketData)) {
|
| 345 |
+
const isPositive = data.change >= 0;
|
| 346 |
+
const changeColor = isPositive ? 'text-green-500' : 'text-red-500';
|
| 347 |
+
const changeIcon = isPositive ? 'fa-caret-up' : 'fa-caret-down';
|
| 348 |
+
|
| 349 |
+
marketOverviewHTML += `
|
| 350 |
+
<div class="bg-gray-700 rounded-lg p-3 card-glow">
|
| 351 |
+
<div class="flex justify-between items-start">
|
| 352 |
+
<div>
|
| 353 |
+
<p class="text-sm text-gray-400">${pair}</p>
|
| 354 |
+
<p class="text-lg font-bold">${data.price.toLocaleString(undefined, { minimumFractionDigits: pair === 'BTCUSD' ? 0 : 4 })}</p>
|
| 355 |
+
</div>
|
| 356 |
+
<div class="${changeColor} text-sm">
|
| 357 |
+
<i class="fas ${changeIcon} mr-1"></i> ${Math.abs(data.change)}%
|
| 358 |
+
</div>
|
| 359 |
+
</div>
|
| 360 |
+
<div class="mt-2 h-12">
|
| 361 |
+
<canvas id="${pair.toLowerCase()}-minichart"></canvas>
|
| 362 |
+
</div>
|
| 363 |
+
</div>
|
| 364 |
+
`;
|
| 365 |
+
}
|
| 366 |
+
|
| 367 |
+
document.getElementById('market-overview').innerHTML = marketOverviewHTML;
|
| 368 |
+
|
| 369 |
+
// Initialize mini charts
|
| 370 |
+
initializeMiniCharts();
|
| 371 |
+
|
| 372 |
+
// Update timestamp
|
| 373 |
+
updateTimestamp();
|
| 374 |
+
} catch (error) {
|
| 375 |
+
console.error('Error loading market data:', error);
|
| 376 |
+
document.getElementById('market-overview').innerHTML = `
|
| 377 |
+
<div class="col-span-8 bg-gray-700 rounded-lg p-4 text-center text-red-400">
|
| 378 |
+
<i class="fas fa-exclamation-triangle mr-2"></i> Failed to load market data
|
| 379 |
+
</div>
|
| 380 |
+
`;
|
| 381 |
+
}
|
| 382 |
+
}
|
| 383 |
+
|
| 384 |
+
// Initialize mini charts
|
| 385 |
+
function initializeMiniCharts() {
|
| 386 |
+
// Simulated price history for mini charts
|
| 387 |
+
const pairs = ['eurusd', 'gbpusd', 'usdjpy', 'audusd', 'usdcad', 'xauusd', 'oilusd', 'btcusd'];
|
| 388 |
+
|
| 389 |
+
pairs.forEach(pair => {
|
| 390 |
+
const ctx = document.getElementById(`${pair}-minichart`).getContext('2d');
|
| 391 |
+
const data = generateRandomChartData(8, pair.includes('usd') ? 0.002 : pair.includes('jpy') ? 0.5 : pair.includes('btc') ? 200 : 2);
|
| 392 |
+
|
| 393 |
+
miniCharts[pair] = new Chart(ctx, {
|
| 394 |
+
type: 'line',
|
| 395 |
+
data: {
|
| 396 |
+
labels: Array(data.length).fill(''),
|
| 397 |
+
datasets: [{
|
| 398 |
+
data: data,
|
| 399 |
+
borderColor: data[data.length - 1] >= data[0] ? '#10b981' : '#ef4444',
|
| 400 |
+
borderWidth: 1,
|
| 401 |
+
tension: 0.4,
|
| 402 |
+
fill: false,
|
| 403 |
+
pointRadius: 0
|
| 404 |
+
}]
|
| 405 |
+
},
|
| 406 |
+
options: {
|
| 407 |
+
responsive: true,
|
| 408 |
+
maintainAspectRatio: false,
|
| 409 |
+
scales: {
|
| 410 |
+
x: { display: false },
|
| 411 |
+
y: { display: false }
|
| 412 |
+
},
|
| 413 |
+
plugins: { legend: { display: false } }
|
| 414 |
+
}
|
| 415 |
+
});
|
| 416 |
+
});
|
| 417 |
+
}
|
| 418 |
+
|
| 419 |
+
// Load main chart data
|
| 420 |
+
async function loadMainChartData() {
|
| 421 |
+
try {
|
| 422 |
+
// In a real app, you would fetch from ForexAPI
|
| 423 |
+
// const response = await axios.get(`${BASE_URL}/history?symbol=${currentPair}&timeframe=${currentTimeframe}&api_key=${API_KEY}`);
|
| 424 |
+
|
| 425 |
+
// Simulated response with realistic data
|
| 426 |
+
const simulatedResponse = {
|
| 427 |
+
data: {
|
| 428 |
+
symbol: 'EURUSD',
|
| 429 |
+
timeframe: currentTimeframe,
|
| 430 |
+
prices: generateRandomChartData(24, 0.005, 1.09),
|
| 431 |
+
high: 1.1023,
|
| 432 |
+
low: 1.0957,
|
| 433 |
+
change: 0.42,
|
| 434 |
+
indicators: {
|
| 435 |
+
rsi: 62.4,
|
| 436 |
+
macd: 0.0012,
|
| 437 |
+
stochastic: 78.2,
|
| 438 |
+
adx: 32.6
|
| 439 |
+
},
|
| 440 |
+
movingAverages: {
|
| 441 |
+
ema10: 1.0972,
|
| 442 |
+
sma20: 1.0958,
|
| 443 |
+
ema50: 1.0924,
|
| 444 |
+
sma100: 1.0887
|
| 445 |
+
},
|
| 446 |
+
pattern: 'Bullish Flag'
|
| 447 |
+
}
|
| 448 |
+
};
|
| 449 |
+
|
| 450 |
+
const chartData = simulatedResponse.data;
|
| 451 |
+
|
| 452 |
+
// Update chart title
|
| 453 |
+
document.getElementById('main-chart-title').textContent = chartData.symbol;
|
| 454 |
+
|
| 455 |
+
// Update price info
|
| 456 |
+
document.getElementById('current-price').textContent = chartData.prices[chartData.prices.length - 1].toFixed(4);
|
| 457 |
+
document.getElementById('daily-high').textContent = chartData.high.toFixed(4);
|
| 458 |
+
document.getElementById('daily-low').textContent = chartData.low.toFixed(4);
|
| 459 |
+
|
| 460 |
+
const changeElement = document.getElementById('daily-change');
|
| 461 |
+
if (chartData.change >= 0) {
|
| 462 |
+
changeElement.className = 'text-lg font-bold text-green-500';
|
| 463 |
+
changeElement.textContent = `+${chartData.change.toFixed(2)}%`;
|
| 464 |
+
} else {
|
| 465 |
+
changeElement.className = 'text-lg font-bold text-red-500';
|
| 466 |
+
changeElement.textContent = `${chartData.change.toFixed(2)}%`;
|
| 467 |
+
}
|
| 468 |
+
|
| 469 |
+
// Create or update main chart
|
| 470 |
+
const ctx = document.getElementById('mainChart').getContext('2d');
|
| 471 |
+
const labels = Array(chartData.prices.length).fill('').map((_, i) => `${i}:00`);
|
| 472 |
+
|
| 473 |
+
if (mainChart) {
|
| 474 |
+
mainChart.destroy();
|
| 475 |
+
}
|
| 476 |
+
|
| 477 |
+
mainChart = new Chart(ctx, {
|
| 478 |
+
type: 'line',
|
| 479 |
+
data: {
|
| 480 |
+
labels: labels,
|
| 481 |
+
datasets: [{
|
| 482 |
+
label: chartData.symbol,
|
| 483 |
+
data: chartData.prices,
|
| 484 |
+
borderColor: '#3b82f6',
|
| 485 |
+
backgroundColor: 'rgba(59, 130, 246, 0.1)',
|
| 486 |
+
borderWidth: 2,
|
| 487 |
+
tension: 0.3,
|
| 488 |
+
fill: true
|
| 489 |
+
}]
|
| 490 |
+
},
|
| 491 |
+
options: {
|
| 492 |
+
responsive: true,
|
| 493 |
+
maintainAspectRatio: false,
|
| 494 |
+
plugins: {
|
| 495 |
+
legend: { display: false },
|
| 496 |
+
tooltip: {
|
| 497 |
+
mode: 'index',
|
| 498 |
+
intersect: false
|
| 499 |
+
}
|
| 500 |
+
},
|
| 501 |
+
scales: {
|
| 502 |
+
y: {
|
| 503 |
+
grid: { color: 'rgba(255, 255, 255, 0.1)' }
|
| 504 |
+
},
|
| 505 |
+
x: {
|
| 506 |
+
grid: { display: false }
|
| 507 |
+
}
|
| 508 |
+
},
|
| 509 |
+
interaction: {
|
| 510 |
+
mode: 'nearest',
|
| 511 |
+
axis: 'x',
|
| 512 |
+
intersect: false
|
| 513 |
+
}
|
| 514 |
+
}
|
| 515 |
+
});
|
| 516 |
+
|
| 517 |
+
// Update AI confidence and signal strength based on indicators
|
| 518 |
+
updateAIConfidence(chartData.indicators, chartData.pattern);
|
| 519 |
+
|
| 520 |
+
// Update timestamp
|
| 521 |
+
updateTimestamp();
|
| 522 |
+
} catch (error) {
|
| 523 |
+
console.error('Error loading chart data:', error);
|
| 524 |
+
document.getElementById('main-chart-title').nextElementSibling.innerHTML = `
|
| 525 |
+
<div class="text-red-400 text-sm">
|
| 526 |
+
<i class="fas fa-exclamation-triangle mr-1"></i> Chart data unavailable
|
| 527 |
+
</div>
|
| 528 |
+
`;
|
| 529 |
+
}
|
| 530 |
+
}
|
| 531 |
+
|
| 532 |
+
// Update AI confidence based on technical indicators
|
| 533 |
+
function updateAIConfidence(indicators, pattern) {
|
| 534 |
+
// Calculate confidence score (simplified)
|
| 535 |
+
let confidence = 70; // Base confidence
|
| 536 |
+
|
| 537 |
+
// RSI between 40-60 is ideal
|
| 538 |
+
if (indicators.rsi > 40 && indicators.rsi < 60) confidence += 10;
|
| 539 |
+
|
| 540 |
+
// Positive MACD is good
|
| 541 |
+
if (indicators.macd > 0) confidence += 5;
|
| 542 |
+
|
| 543 |
+
// Strong ADX (>25) is good
|
| 544 |
+
if (indicators.adx > 25) confidence += 10;
|
| 545 |
+
|
| 546 |
+
// Bullish pattern adds confidence
|
| 547 |
+
if (pattern.includes('Bullish')) confidence += 10;
|
| 548 |
+
|
| 549 |
+
// Cap at 95%
|
| 550 |
+
confidence = Math.min(95, confidence);
|
| 551 |
+
|
| 552 |
+
// Update UI
|
| 553 |
+
document.getElementById('ai-confidence').textContent = `${confidence}%`;
|
| 554 |
+
|
| 555 |
+
// Update signal strength
|
| 556 |
+
const signalElement = document.getElementById('signal-strength');
|
| 557 |
+
if (confidence >= 85) {
|
| 558 |
+
signalElement.className = 'bg-green-600 px-2 py-1 rounded-full text-xs';
|
| 559 |
+
signalElement.innerHTML = '<span>STRONG BUY</span>';
|
| 560 |
+
} else if (confidence >= 70) {
|
| 561 |
+
signalElement.className = 'bg-green-500 px-2 py-1 rounded-full text-xs';
|
| 562 |
+
signalElement.innerHTML = '<span>BUY</span>';
|
| 563 |
+
} else if (confidence >= 55) {
|
| 564 |
+
signalElement.className = 'bg-yellow-500 px-2 py-1 rounded-full text-xs';
|
| 565 |
+
signalElement.innerHTML = '<span>NEUTRAL</span>';
|
| 566 |
+
} else if (confidence >= 40) {
|
| 567 |
+
signalElement.className = 'bg-red-500 px-2 py-1 rounded-full text-xs';
|
| 568 |
+
signalElement.innerHTML = '<span>SELL</span>';
|
| 569 |
+
} else {
|
| 570 |
+
signalElement.className = 'bg-red-600 px-2 py-1 rounded-full text-xs';
|
| 571 |
+
signalElement.innerHTML = '<span>STRONG SELL</span>';
|
| 572 |
+
}
|
| 573 |
+
}
|
| 574 |
+
|
| 575 |
+
// Load trading signals
|
| 576 |
+
async function loadTradingSignals() {
|
| 577 |
+
try {
|
| 578 |
+
// In a real app, you would fetch from your API
|
| 579 |
+
// const response = await axios.get(`${BASE_URL}/signals?api_key=${API_KEY}`);
|
| 580 |
+
|
| 581 |
+
// Simulated response with realistic signals
|
| 582 |
+
const simulatedResponse = {
|
| 583 |
+
data: [
|
| 584 |
+
{
|
| 585 |
+
pair: 'EURUSD',
|
| 586 |
+
timeframe: '1H',
|
| 587 |
+
signal: 'BUY',
|
| 588 |
+
entry: 1.0975,
|
| 589 |
+
take_profit: 1.1025,
|
| 590 |
+
stop_loss: 1.0950,
|
| 591 |
+
confidence: 87,
|
| 592 |
+
updated: new Date().toISOString()
|
| 593 |
+
},
|
| 594 |
+
{
|
| 595 |
+
pair: 'USDJPY',
|
| 596 |
+
timeframe: '4H',
|
| 597 |
+
signal: 'SELL',
|
| 598 |
+
entry: 138.85,
|
| 599 |
+
take_profit: 137.50,
|
| 600 |
+
stop_loss: 139.50,
|
| 601 |
+
confidence: 76,
|
| 602 |
+
updated: new Date().toISOString()
|
| 603 |
+
},
|
| 604 |
+
{
|
| 605 |
+
pair: 'GBPUSD',
|
| 606 |
+
timeframe: 'D',
|
| 607 |
+
signal: 'HOLD',
|
| 608 |
+
entry_range: '1.2600-1.2620',
|
| 609 |
+
take_profit: 1.2700,
|
| 610 |
+
stop_loss: 1.2550,
|
| 611 |
+
confidence: 68,
|
| 612 |
+
updated: new Date().toISOString()
|
| 613 |
+
},
|
| 614 |
+
{
|
| 615 |
+
pair: 'XAUUSD',
|
| 616 |
+
timeframe: '1H',
|
| 617 |
+
signal: 'BUY',
|
| 618 |
+
entry: 1975.00,
|
| 619 |
+
take_profit: 1990.00,
|
| 620 |
+
stop_loss: 1965.00,
|
| 621 |
+
confidence: 82,
|
| 622 |
+
updated: new Date().toISOString()
|
| 623 |
+
}
|
| 624 |
+
]
|
| 625 |
+
};
|
| 626 |
+
|
| 627 |
+
const signals = simulatedResponse.data;
|
| 628 |
+
let signalsHTML = '';
|
| 629 |
+
|
| 630 |
+
signals.forEach(signal => {
|
| 631 |
+
const signalClass = signal.signal === 'BUY' ? 'signal-buy' :
|
| 632 |
+
signal.signal === 'SELL' ? 'signal-sell' : 'signal-neutral';
|
| 633 |
+
const signalColor = signal.signal === 'BUY' ? 'bg-green-600' :
|
| 634 |
+
signal.signal === 'SELL' ? 'bg-red-600' : 'bg-yellow-600';
|
| 635 |
+
|
| 636 |
+
signalsHTML += `
|
| 637 |
+
<div class="bg-gray-700 rounded-lg p-3 ${signalClass}">
|
| 638 |
+
<div class="flex justify-between items-start">
|
| 639 |
+
<div>
|
| 640 |
+
<p class="font-medium">${signal.pair}</p>
|
| 641 |
+
<p class="text-sm text-gray-400">${signal.timeframe} Timeframe</p>
|
| 642 |
+
</div>
|
| 643 |
+
<div class="${signalColor} px-2 py-1 rounded-full text-xs">
|
| 644 |
+
<span>${signal.signal}</span>
|
| 645 |
+
</div>
|
| 646 |
+
</div>
|
| 647 |
+
<div class="mt-2 text-sm">
|
| 648 |
+
<div class="flex justify-between">
|
| 649 |
+
<span class="text-gray-400">Entry:</span>
|
| 650 |
+
<span>${signal.entry_range || signal.entry}</span>
|
| 651 |
+
</div>
|
| 652 |
+
<div class="flex justify-between">
|
| 653 |
+
<span class="text-gray-400">Take Profit:</span>
|
| 654 |
+
<span>${signal.take_profit}</span>
|
| 655 |
+
</div>
|
| 656 |
+
<div class="flex justify-between">
|
| 657 |
+
<span class="text-gray-400">Stop Loss:</span>
|
| 658 |
+
<span>${signal.stop_loss}</span>
|
| 659 |
+
</div>
|
| 660 |
+
</div>
|
| 661 |
+
<div class="mt-2 flex justify-between items-center text-xs">
|
| 662 |
+
<span class="text-gray-400">Confidence: ${signal.confidence}%</span>
|
| 663 |
+
<button class="bg-blue-600 hover:bg-blue-700 px-2 py-1 rounded text-xs">
|
| 664 |
+
${signal.signal === 'HOLD' ? 'Pending' : 'Execute'}
|
| 665 |
+
</button>
|
| 666 |
+
</div>
|
| 667 |
+
</div>
|
| 668 |
+
`;
|
| 669 |
+
});
|
| 670 |
+
|
| 671 |
+
document.getElementById('trading-signals').innerHTML = signalsHTML;
|
| 672 |
+
document.getElementById('signals-updated').textContent = 'Just now';
|
| 673 |
+
|
| 674 |
+
// Update timestamp
|
| 675 |
+
updateTimestamp();
|
| 676 |
+
} catch (error) {
|
| 677 |
+
console.error('Error loading trading signals:', error);
|
| 678 |
+
document.getElementById('trading-signals').innerHTML = `
|
| 679 |
+
<div class="bg-gray-700 rounded-lg p-4 text-center text-red-400">
|
| 680 |
+
<i class="fas fa-exclamation-triangle mr-2"></i> Failed to load signals
|
| 681 |
+
</div>
|
| 682 |
+
`;
|
| 683 |
+
}
|
| 684 |
+
}
|
| 685 |
+
|
| 686 |
+
// Load technical analysis
|
| 687 |
+
async function loadTechnicalAnalysis() {
|
| 688 |
+
try {
|
| 689 |
+
// In a real app, you would fetch from your API
|
| 690 |
+
// const response = await axios.get(`${BASE_URL}/analysis/technical?symbol=${currentPair}&api_key=${API_KEY}`);
|
| 691 |
+
|
| 692 |
+
// Simulated response with realistic data
|
| 693 |
+
const simulatedResponse = {
|
| 694 |
+
data: {
|
| 695 |
+
indicators: {
|
| 696 |
+
rsi: 62.4,
|
| 697 |
+
macd: 0.0012,
|
| 698 |
+
stochastic: 78.2,
|
| 699 |
+
adx: 32.6
|
| 700 |
+
},
|
| 701 |
+
moving_averages: {
|
| 702 |
+
ema10: { value: 1.0972, trend: 'up' },
|
| 703 |
+
sma20: { value: 1.0958, trend: 'up' },
|
| 704 |
+
ema50: { value: 1.0924, trend: 'up' },
|
| 705 |
+
sma100: { value: 1.0887, trend: 'up' }
|
| 706 |
+
},
|
| 707 |
+
pivot_points: {
|
| 708 |
+
r3: 1.1089,
|
| 709 |
+
r2: 1.1057,
|
| 710 |
+
r1: 1.1021,
|
| 711 |
+
pp: 1.0989,
|
| 712 |
+
s1: 1.0953,
|
| 713 |
+
s2: 1.0921
|
| 714 |
+
},
|
| 715 |
+
patterns: [
|
| 716 |
+
{ name: 'Bullish Flag', reliability: 85 },
|
| 717 |
+
{ name: 'Higher Highs', reliability: 80 }
|
| 718 |
+
],
|
| 719 |
+
fibonacci: {
|
| 720 |
+
level_618: 1.1025
|
| 721 |
+
}
|
| 722 |
+
}
|
| 723 |
+
};
|
| 724 |
+
|
| 725 |
+
const analysis = simulatedResponse.data;
|
| 726 |
+
let analysisHTML = `
|
| 727 |
+
<div class="bg-gray-700 rounded-lg p-4">
|
| 728 |
+
<h3 class="font-medium mb-2">Indicators</h3>
|
| 729 |
+
<div class="space-y-3">
|
| 730 |
+
<div>
|
| 731 |
+
<div class="flex justify-between text-sm">
|
| 732 |
+
<span>RSI (14)</span>
|
| 733 |
+
<span class="font-mono">${analysis.indicators.rsi}</span>
|
| 734 |
+
</div>
|
| 735 |
+
<div class="w-full bg-gray-600 rounded-full h-1.5 mt-1">
|
| 736 |
+
<div class="bg-blue-500 h-1.5 rounded-full" style="width: ${analysis.indicators.rsi}%"></div>
|
| 737 |
+
</div>
|
| 738 |
+
</div>
|
| 739 |
+
<div>
|
| 740 |
+
<div class="flex justify-between text-sm">
|
| 741 |
+
<span>MACD (12,26,9)</span>
|
| 742 |
+
<span class="font-mono">${analysis.indicators.macd > 0 ? '+' : ''}${analysis.indicators.macd}</span>
|
| 743 |
+
</div>
|
| 744 |
+
<div class="w-full bg-gray-600 rounded-full h-1.5 mt-1">
|
| 745 |
+
<div class="bg-green-500 h-1.5 rounded-full" style="width: ${70}%"></div>
|
| 746 |
+
</div>
|
| 747 |
+
</div>
|
| 748 |
+
<div>
|
| 749 |
+
<div class="flex justify-between text-sm">
|
| 750 |
+
<span>Stochastic (14,3,3)</span>
|
| 751 |
+
<span class="font-mono">${analysis.indicators.stochastic}</span>
|
| 752 |
+
</div>
|
| 753 |
+
<div class="w-full bg-gray-600 rounded-full h-1.5 mt-1">
|
| 754 |
+
<div class="bg-yellow-500 h-1.5 rounded-full" style="width: ${analysis.indicators.stochastic}%"></div>
|
| 755 |
+
</div>
|
| 756 |
+
</div>
|
| 757 |
+
<div>
|
| 758 |
+
<div class="flex justify-between text-sm">
|
| 759 |
+
<span>ADX (14)</span>
|
| 760 |
+
<span class="font-mono">${analysis.indicators.adx}</span>
|
| 761 |
+
</div>
|
| 762 |
+
<div class="w-full bg-gray-600 rounded-full h-1.5 mt-1">
|
| 763 |
+
<div class="bg-purple-500 h-1.5 rounded-full" style="width: ${analysis.indicators.adx}%"></div>
|
| 764 |
+
</div>
|
| 765 |
+
</div>
|
| 766 |
+
</div>
|
| 767 |
+
</div>
|
| 768 |
+
<div class="bg-gray-700 rounded-lg p-4">
|
| 769 |
+
<h3 class="font-medium mb-2">Moving Averages</h3>
|
| 770 |
+
<div class="space-y-3">
|
| 771 |
+
<div>
|
| 772 |
+
<div class="flex justify-between text-sm">
|
| 773 |
+
<span>EMA (10)</span>
|
| 774 |
+
<span class="font-mono">${analysis.moving_averages.ema10.value} <span class="text-green-500">↑</span></span>
|
| 775 |
+
</div>
|
| 776 |
+
<div class="text-xs text-gray-400">Bullish Crossover</div>
|
| 777 |
+
</div>
|
| 778 |
+
<div>
|
| 779 |
+
<div class="flex justify-between text-sm">
|
| 780 |
+
<span>SMA (20)</span>
|
| 781 |
+
<span class="font-mono">${analysis.moving_averages.sma20.value} <span class="text-green-500">↑</span></span>
|
| 782 |
+
</div>
|
| 783 |
+
<div class="text-xs text-gray-400">Support Level</div>
|
| 784 |
+
</div>
|
| 785 |
+
<div>
|
| 786 |
+
<div class="flex justify-between text-sm">
|
| 787 |
+
<span>EMA (50)</span>
|
| 788 |
+
<span class="font-mono">${analysis.moving_averages.ema50.value} <span class="text-green-500">↑</span></span>
|
| 789 |
+
</div>
|
| 790 |
+
<div class="text-xs text-gray-400">Strong Support</div>
|
| 791 |
+
</div>
|
| 792 |
+
<div>
|
| 793 |
+
<div class="flex justify-between text-sm">
|
| 794 |
+
<span>SMA (100)</span>
|
| 795 |
+
<span class="font-mono">${analysis.moving_averages.sma100.value} <span class="text-green-500">↑</span></span>
|
| 796 |
+
</div>
|
| 797 |
+
<div class="text-xs text-gray-400">Long-term Trend</div>
|
| 798 |
+
</div>
|
| 799 |
+
</div>
|
| 800 |
+
</div>
|
| 801 |
+
<div class="bg-gray-700 rounded-lg p-4">
|
| 802 |
+
<h3 class="font-medium mb-2">Pivot Points</h3>
|
| 803 |
+
<div class="grid grid-cols-3 gap-2 text-sm">
|
| 804 |
+
<div class="bg-gray-600 p-2 rounded text-center">
|
| 805 |
+
<div class="text-gray-400">R3</div>
|
| 806 |
+
<div>${analysis.pivot_points.r3}</div>
|
| 807 |
+
</div>
|
| 808 |
+
<div class="bg-gray-600 p-2 rounded text-center">
|
| 809 |
+
<div class="text-gray-400">R2</div>
|
| 810 |
+
<div>${analysis.pivot_points.r2}</div>
|
| 811 |
+
</div>
|
| 812 |
+
<div class="bg-gray-600 p-2 rounded text-center">
|
| 813 |
+
<div class="text-gray-400">R1</div>
|
| 814 |
+
<div>${analysis.pivot_points.r1}</div>
|
| 815 |
+
</div>
|
| 816 |
+
<div class="bg-gray-600 p-2 rounded text-center">
|
| 817 |
+
<div class="text-gray-400">PP</div>
|
| 818 |
+
<div>${analysis.pivot_points.pp}</div>
|
| 819 |
+
</div>
|
| 820 |
+
<div class="bg-gray-600 p-2 rounded text-center">
|
| 821 |
+
<div class="text-gray-400">S1</div>
|
| 822 |
+
<div>${analysis.pivot_points.s1}</div>
|
| 823 |
+
</div>
|
| 824 |
+
<div class="bg-gray-600 p-2 rounded text-center">
|
| 825 |
+
<div class="text-gray-400">S2</div>
|
| 826 |
+
<div>${analysis.pivot_points.s2}</div>
|
| 827 |
+
</div>
|
| 828 |
+
</div>
|
| 829 |
+
</div>
|
| 830 |
+
<div class="bg-gray-700 rounded-lg p-4">
|
| 831 |
+
<h3 class="font-medium mb-2">Pattern Recognition</h3>
|
| 832 |
+
<div class="flex items-center space-x-3">
|
| 833 |
+
<div class="bg-blue-500 p-2 rounded-full">
|
| 834 |
+
<i class="fas fa-chart-line text-white"></i>
|
| 835 |
+
</div>
|
| 836 |
+
<div>
|
| 837 |
+
<p class="font-medium">${analysis.patterns[0].name}</p>
|
| 838 |
+
<p class="text-xs text-gray-400">${analysis.patterns[0].reliability}% reliability</p>
|
| 839 |
+
</div>
|
| 840 |
+
</div>
|
| 841 |
+
<div class="mt-3 flex items-center space-x-3">
|
| 842 |
+
<div class="bg-green-500 p-2 rounded-full">
|
| 843 |
+
<i class="fas fa-arrow-up text-white"></i>
|
| 844 |
+
</div>
|
| 845 |
+
<div>
|
| 846 |
+
<p class="font-medium">${analysis.patterns[1].name}</p>
|
| 847 |
+
<p class="text-xs text-gray-400">3 consecutive</p>
|
| 848 |
+
</div>
|
| 849 |
+
</div>
|
| 850 |
+
<div class="mt-3">
|
| 851 |
+
<p class="text-sm">Fibonacci Extension: ${analysis.fibonacci.level_618} (61.8%)</p>
|
| 852 |
+
<div class="w-full bg-gray-600 rounded-full h-1.5 mt-1">
|
| 853 |
+
<div class="bg-yellow-500 h-1.5 rounded-full" style="width: 61.8%"></div>
|
| 854 |
+
</div>
|
| 855 |
+
</div>
|
| 856 |
+
</div>
|
| 857 |
+
`;
|
| 858 |
+
|
| 859 |
+
document.getElementById('technical-analysis').innerHTML = analysisHTML;
|
| 860 |
+
|
| 861 |
+
// Update timestamp
|
| 862 |
+
updateTimestamp();
|
| 863 |
+
} catch (error) {
|
| 864 |
+
console.error('Error loading technical analysis:', error);
|
| 865 |
+
document.getElementById('technical-analysis').innerHTML = `
|
| 866 |
+
<div class="col-span-2 bg-gray-700 rounded-lg p-4 text-center text-red-400">
|
| 867 |
+
<i class="fas fa-exclamation-triangle mr-2"></i> Failed to load technical analysis
|
| 868 |
+
</div>
|
| 869 |
+
`;
|
| 870 |
+
}
|
| 871 |
+
}
|
| 872 |
+
|
| 873 |
+
// Load fundamental analysis
|
| 874 |
+
async function loadFundamentalAnalysis() {
|
| 875 |
+
try {
|
| 876 |
+
// In a real app, you would fetch from your API
|
| 877 |
+
// const response = await axios.get(`${BASE_URL}/analysis/fundamental?symbol=${currentPair}&api_key=${API_KEY}`);
|
| 878 |
+
|
| 879 |
+
// Simulated response with realistic data
|
| 880 |
+
const simulatedResponse = {
|
| 881 |
+
data: {
|
| 882 |
+
calendar: [
|
| 883 |
+
{
|
| 884 |
+
event: 'USD: Fed Interest Rate',
|
| 885 |
+
time: 'Today, 18:00 GMT',
|
| 886 |
+
impact: 'High'
|
| 887 |
+
},
|
| 888 |
+
{
|
| 889 |
+
event: 'EUR: ECB President Speech',
|
| 890 |
+
time: 'Today, 14:30 GMT',
|
| 891 |
+
impact: 'Medium'
|
| 892 |
+
},
|
| 893 |
+
{
|
| 894 |
+
event: 'USD: Non-Farm Payrolls',
|
| 895 |
+
time: 'Tomorrow, 12:30 GMT',
|
| 896 |
+
impact: 'High'
|
| 897 |
+
}
|
| 898 |
+
],
|
| 899 |
+
sentiment: {
|
| 900 |
+
market: 72,
|
| 901 |
+
retail: 58,
|
| 902 |
+
institutional: 67
|
| 903 |
+
},
|
| 904 |
+
news: [
|
| 905 |
+
{
|
| 906 |
+
title: 'Fed Pause Expected',
|
| 907 |
+
summary: 'Dollar weakness likely to continue'
|
| 908 |
+
},
|
| 909 |
+
{
|
| 910 |
+
title: 'Eurozone Inflation',
|
| 911 |
+
summary: 'Core CPI remains sticky at 5.3%'
|
| 912 |
+
},
|
| 913 |
+
{
|
| 914 |
+
title: 'Banking Concerns',
|
| 915 |
+
summary: 'Safe-haven flows supporting EUR'
|
| 916 |
+
}
|
| 917 |
+
]
|
| 918 |
+
}
|
| 919 |
+
};
|
| 920 |
+
|
| 921 |
+
const analysis = simulatedResponse.data;
|
| 922 |
+
let analysisHTML = `
|
| 923 |
+
<div class="bg-gray-700 rounded-lg p-4">
|
| 924 |
+
<h3 class="font-medium mb-2">Economic Calendar</h3>
|
| 925 |
+
<div class="space-y-3 text-sm">
|
| 926 |
+
${analysis.calendar.map(item => `
|
| 927 |
+
<div class="flex justify-between items-center">
|
| 928 |
+
<div>
|
| 929 |
+
<p class="font-medium">${item.event}</p>
|
| 930 |
+
<p class="text-gray-400">${item.time}</p>
|
| 931 |
+
</div>
|
| 932 |
+
<span class="${item.impact === 'High' ? 'bg-red-100 text-red-800' : 'bg-yellow-100 text-yellow-800'} px-2 py-1 rounded-full text-xs">
|
| 933 |
+
${item.impact} Impact
|
| 934 |
+
</span>
|
| 935 |
+
</div>
|
| 936 |
+
`).join('')}
|
| 937 |
+
</div>
|
| 938 |
+
</div>
|
| 939 |
+
<div class="bg-gray-700 rounded-lg p-4">
|
| 940 |
+
<h3 class="font-medium mb-2">Sentiment Analysis</h3>
|
| 941 |
+
<div class="space-y-3">
|
| 942 |
+
<div>
|
| 943 |
+
<div class="flex justify-between text-sm">
|
| 944 |
+
<span>Market Sentiment</span>
|
| 945 |
+
<span class="font-mono">${analysis.sentiment.market}% Bullish</span>
|
| 946 |
+
</div>
|
| 947 |
+
<div class="w-full bg-gray-600 rounded-full h-1.5 mt-1">
|
| 948 |
+
<div class="bg-green-500 h-1.5 rounded-full" style="width: ${analysis.sentiment.market}%"></div>
|
| 949 |
+
</div>
|
| 950 |
+
</div>
|
| 951 |
+
<div>
|
| 952 |
+
<div class="flex justify-between text-sm">
|
| 953 |
+
<span>Retail Traders</span>
|
| 954 |
+
<span class="font-mono">${analysis.sentiment.retail}% Short</span>
|
| 955 |
+
</div>
|
| 956 |
+
<div class="w-full bg-gray-600 rounded-full h-1.5 mt-1">
|
| 957 |
+
<div class="bg-red-500 h-1.5 rounded-full" style="width: ${analysis.sentiment.retail}%"></div>
|
| 958 |
+
</div>
|
| 959 |
+
</div>
|
| 960 |
+
<div>
|
| 961 |
+
<div class="flex justify-between text-sm">
|
| 962 |
+
<span>Institutional Bias</span>
|
| 963 |
+
<span class="font-mono">${analysis.sentiment.institutional}% Long</span>
|
| 964 |
+
</div>
|
| 965 |
+
<div class="w-full bg-gray-600 rounded-full h-1.5 mt-1">
|
| 966 |
+
<div class="bg-green-500 h-1.5 rounded-full" style="width: ${analysis.sentiment.institutional}%"></div>
|
| 967 |
+
</div>
|
| 968 |
+
</div>
|
| 969 |
+
</div>
|
| 970 |
+
</div>
|
| 971 |
+
<div class="bg-gray-700 rounded-lg p-4">
|
| 972 |
+
<h3 class="font-medium mb-2">News Impact</h3>
|
| 973 |
+
<div class="space-y-3 text-sm">
|
| 974 |
+
${analysis.news.map((item, index) => `
|
| 975 |
+
<div class="flex items-start">
|
| 976 |
+
<div class="${index === 0 ? 'bg-blue-500' : index === 1 ? 'bg-green-500' : 'bg-red-500'} p-1 rounded-full mr-2 mt-1">
|
| 977 |
+
<i class="${index === 0 ? 'fas fa-newspaper' : index === 1 ? 'fas fa-chart-line' : 'fas fa-exclamation-triangle'} text-white text-xs"></i>
|
| 978 |
+
</div>
|
| 979 |
+
<div>
|
| 980 |
+
<p class="font-medium">${item.title}</p>
|
| 981 |
+
<p class="text-gray-400">${item.summary}</p>
|
| 982 |
+
</div>
|
| 983 |
+
</div>
|
| 984 |
+
`).join('')}
|
| 985 |
+
</div>
|
| 986 |
+
</div>
|
| 987 |
+
`;
|
| 988 |
+
|
| 989 |
+
document.getElementById('fundamental-analysis').innerHTML = analysisHTML;
|
| 990 |
+
|
| 991 |
+
// Update timestamp
|
| 992 |
+
updateTimestamp();
|
| 993 |
+
} catch (error) {
|
| 994 |
+
console.error('Error loading fundamental analysis:', error);
|
| 995 |
+
document.getElementById('fundamental-analysis').innerHTML = `
|
| 996 |
+
<div class="bg-gray-700 rounded-lg p-4 text-center text-red-400">
|
| 997 |
+
<i class="fas fa-exclamation-triangle mr-2"></i> Failed to load fundamental analysis
|
| 998 |
+
</div>
|
| 999 |
+
`;
|
| 1000 |
+
}
|
| 1001 |
+
}
|
| 1002 |
+
|
| 1003 |
+
// Load risk management
|
| 1004 |
+
async function loadRiskManagement() {
|
| 1005 |
+
try {
|
| 1006 |
+
// In a real app, you would fetch from your API
|
| 1007 |
+
// const response = await axios.get(`${BASE_URL}/risk?api_key=${API_KEY}`);
|
| 1008 |
+
|
| 1009 |
+
// Simulated response with realistic data
|
| 1010 |
+
const simulatedResponse = {
|
| 1011 |
+
data: {
|
| 1012 |
+
allocation: {
|
| 1013 |
+
EURUSD: 35,
|
| 1014 |
+
USDJPY: 25,
|
| 1015 |
+
XAUUSD: 20,
|
| 1016 |
+
Cash: 15,
|
| 1017 |
+
Other: 5
|
| 1018 |
+
},
|
| 1019 |
+
parameters: {
|
| 1020 |
+
max_risk: 2,
|
| 1021 |
+
drawdown: 5,
|
| 1022 |
+
volatility: 'Medium'
|
| 1023 |
+
},
|
| 1024 |
+
performance: {
|
| 1025 |
+
win_rate: 78,
|
| 1026 |
+
profit_factor: 2.4,
|
| 1027 |
+
avg_win_loss: 1.8,
|
| 1028 |
+
sharpe_ratio: 1.6
|
| 1029 |
+
}
|
| 1030 |
+
}
|
| 1031 |
+
};
|
| 1032 |
+
|
| 1033 |
+
const riskData = simulatedResponse.data;
|
| 1034 |
+
let riskHTML = `
|
| 1035 |
+
<div class="bg-gray-700 rounded-lg p-4">
|
| 1036 |
+
<h3 class="font-medium mb-3">Portfolio Allocation</h3>
|
| 1037 |
+
<div class="h-40">
|
| 1038 |
+
<canvas id="allocationChart"></canvas>
|
| 1039 |
+
</div>
|
| 1040 |
+
<div class="mt-3 grid grid-cols-3 gap-2 text-xs">
|
| 1041 |
+
<div class="flex items-center">
|
| 1042 |
+
<div class="w-3 h-3 bg-blue-500 rounded-full mr-1"></div>
|
| 1043 |
+
<span>EUR/USD</span>
|
| 1044 |
+
</div>
|
| 1045 |
+
<div class="flex items-center">
|
| 1046 |
+
<div class="w-3 h-3 bg-green-500 rounded-full mr-1"></div>
|
| 1047 |
+
<span>USD/JPY</span>
|
| 1048 |
+
</div>
|
| 1049 |
+
<div class="flex items-center">
|
| 1050 |
+
<div class="w-3 h-3 bg-purple-500 rounded-full mr-1"></div>
|
| 1051 |
+
<span>XAU/USD</span>
|
| 1052 |
+
</div>
|
| 1053 |
+
<div class="flex items-center">
|
| 1054 |
+
<div class="w-3 h-3 bg-yellow-500 rounded-full mr-1"></div>
|
| 1055 |
+
<span>Cash</span>
|
| 1056 |
+
</div>
|
| 1057 |
+
<div class="flex items-center">
|
| 1058 |
+
<div class="w-3 h-3 bg-red-500 rounded-full mr-1"></div>
|
| 1059 |
+
<span>Other</span>
|
| 1060 |
+
</div>
|
| 1061 |
+
</div>
|
| 1062 |
+
</div>
|
| 1063 |
+
<div class="bg-gray-700 rounded-lg p-4">
|
| 1064 |
+
<h3 class="font-medium mb-3">Risk Parameters</h3>
|
| 1065 |
+
<div class="space-y-3 text-sm">
|
| 1066 |
+
<div>
|
| 1067 |
+
<div class="flex justify-between">
|
| 1068 |
+
<span>Max Risk per Trade</span>
|
| 1069 |
+
<span>${riskData.parameters.max_risk}%</span>
|
| 1070 |
+
</div>
|
| 1071 |
+
<div class="w-full bg-gray-600 rounded-full h-1.5 mt-1">
|
| 1072 |
+
<div class="bg-blue-500 h-1.5 rounded-full" style="width: ${riskData.parameters.max_risk * 10}%"></div>
|
| 1073 |
+
</div>
|
| 1074 |
+
</div>
|
| 1075 |
+
<div>
|
| 1076 |
+
<div class="flex justify-between">
|
| 1077 |
+
<span>Daily Drawdown Limit</span>
|
| 1078 |
+
<span>${riskData.parameters.drawdown}%</span>
|
| 1079 |
+
</div>
|
| 1080 |
+
<div class="w-full bg-gray-600 rounded-full h-1.5 mt-1">
|
| 1081 |
+
<div class="bg-green-500 h-1.5 rounded-full" style="width: ${riskData.parameters.drawdown * 2}%"></div>
|
| 1082 |
+
</div>
|
| 1083 |
+
</div>
|
| 1084 |
+
<div>
|
| 1085 |
+
<div class="flex justify-between">
|
| 1086 |
+
<span>Portfolio Volatility</span>
|
| 1087 |
+
<span>${riskData.parameters.volatility}</span>
|
| 1088 |
+
</div>
|
| 1089 |
+
<div class="w-full bg-gray-600 rounded-full h-1.5 mt-1">
|
| 1090 |
+
<div class="bg-yellow-500 h-1.5 rounded-full" style="width: ${riskData.parameters.volatility === 'Low' ? 30 : riskData.parameters.volatility === 'Medium' ? 60 : 90}%"></div>
|
| 1091 |
+
</div>
|
| 1092 |
+
</div>
|
| 1093 |
+
</div>
|
| 1094 |
+
</div>
|
| 1095 |
+
<div class="bg-gray-700 rounded-lg p-4">
|
| 1096 |
+
<h3 class="font-medium mb-2">Performance Metrics</h3>
|
| 1097 |
+
<div class="grid grid-cols-2 gap-3 text-sm">
|
| 1098 |
+
<div class="bg-gray-600 p-2 rounded">
|
| 1099 |
+
<div class="text-gray-400">Win Rate</div>
|
| 1100 |
+
<div class="font-bold text-green-500">${riskData.performance.win_rate}%</div>
|
| 1101 |
+
</div>
|
| 1102 |
+
<div class="bg-gray-600 p-2 rounded">
|
| 1103 |
+
<div class="text-gray-400">Profit Factor</div>
|
| 1104 |
+
<div class="font-bold text-green-500">${riskData.performance.profit_factor}</div>
|
| 1105 |
+
</div>
|
| 1106 |
+
<div class="bg-gray-600 p-2 rounded">
|
| 1107 |
+
<div class="text-gray-400">Avg Win/Loss</div>
|
| 1108 |
+
<div class="font-bold text-green-500">${riskData.performance.avg_win_loss}</div>
|
| 1109 |
+
</div>
|
| 1110 |
+
<div class="bg-gray-600 p-2 rounded">
|
| 1111 |
+
<div class="text-gray-400">Sharpe Ratio</div>
|
| 1112 |
+
<div class="font-bold text-green-500">${riskData.performance.sharpe_ratio}</div>
|
| 1113 |
+
</div>
|
| 1114 |
+
</div>
|
| 1115 |
+
</div>
|
| 1116 |
+
`;
|
| 1117 |
+
|
| 1118 |
+
document.getElementById('risk-management').innerHTML = riskHTML;
|
| 1119 |
+
|
| 1120 |
+
// Initialize allocation chart
|
| 1121 |
+
if (allocationChart) {
|
| 1122 |
+
allocationChart.destroy();
|
| 1123 |
+
}
|
| 1124 |
+
|
| 1125 |
+
const ctx = document.getElementById('allocationChart').getContext('2d');
|
| 1126 |
+
allocationChart = new Chart(ctx, {
|
| 1127 |
+
type: 'doughnut',
|
| 1128 |
+
data: {
|
| 1129 |
+
labels: ['EUR/USD', 'USD/JPY', 'XAU/USD', 'Cash', 'Other'],
|
| 1130 |
+
datasets: [{
|
| 1131 |
+
data: [
|
| 1132 |
+
riskData.allocation.EURUSD,
|
| 1133 |
+
riskData.allocation.USDJPY,
|
| 1134 |
+
riskData.allocation.XAUUSD,
|
| 1135 |
+
riskData.allocation.Cash,
|
| 1136 |
+
riskData.allocation.Other
|
| 1137 |
+
],
|
| 1138 |
+
backgroundColor: [
|
| 1139 |
+
'#3b82f6',
|
| 1140 |
+
'#10b981',
|
| 1141 |
+
'#8b5cf6',
|
| 1142 |
+
'#f59e0b',
|
| 1143 |
+
'#ef4444'
|
| 1144 |
+
],
|
| 1145 |
+
borderWidth: 0
|
| 1146 |
+
}]
|
| 1147 |
+
},
|
| 1148 |
+
options: {
|
| 1149 |
+
responsive: true,
|
| 1150 |
+
maintainAspectRatio: false,
|
| 1151 |
+
plugins: {
|
| 1152 |
+
legend: { display: false }
|
| 1153 |
+
},
|
| 1154 |
+
cutout: '70%'
|
| 1155 |
+
}
|
| 1156 |
+
});
|
| 1157 |
+
|
| 1158 |
+
// Update timestamp
|
| 1159 |
+
updateTimestamp();
|
| 1160 |
+
} catch (error) {
|
| 1161 |
+
console.error('Error loading risk management:', error);
|
| 1162 |
+
document.getElementById('risk-management').innerHTML = `
|
| 1163 |
+
<div class="bg-gray-700 rounded-lg p-4 text-center text-red-400">
|
| 1164 |
+
<i class="fas fa-exclamation-triangle mr-2"></i> Failed to load risk data
|
| 1165 |
+
</div>
|
| 1166 |
+
`;
|
| 1167 |
+
}
|
| 1168 |
+
}
|
| 1169 |
+
|
| 1170 |
+
// Load trade execution
|
| 1171 |
+
async function loadTradeExecution() {
|
| 1172 |
+
try {
|
| 1173 |
+
// In a real app, you would fetch from your API
|
| 1174 |
+
// const response = await axios.get(`${BASE_URL}/trades?api_key=${API_KEY}`);
|
| 1175 |
+
|
| 1176 |
+
// Simulated response with realistic data
|
| 1177 |
+
const simulatedResponse = {
|
| 1178 |
+
data: {
|
| 1179 |
+
active_trades: [
|
| 1180 |
+
{
|
| 1181 |
+
pair: 'EURUSD',
|
| 1182 |
+
direction: 'BUY',
|
| 1183 |
+
entry: 1.0975,
|
| 1184 |
+
current: 1.0985,
|
| 1185 |
+
pnl: 1.2
|
| 1186 |
+
},
|
| 1187 |
+
{
|
| 1188 |
+
pair: 'USDJPY',
|
| 1189 |
+
direction: 'SELL',
|
| 1190 |
+
entry: 138.85,
|
| 1191 |
+
current: 139.50,
|
| 1192 |
+
pnl: -0.5
|
| 1193 |
+
}
|
| 1194 |
+
],
|
| 1195 |
+
total_pnl: 342.50
|
| 1196 |
+
}
|
| 1197 |
+
};
|
| 1198 |
+
|
| 1199 |
+
const trades = simulatedResponse.data;
|
| 1200 |
+
let executionHTML = `
|
| 1201 |
+
<div class="bg-gray-700 rounded-lg p-4">
|
| 1202 |
+
<div class="flex justify-between items-center mb-3">
|
| 1203 |
+
<h3 class="font-medium">Quick Trade</h3>
|
| 1204 |
+
<div class="relative">
|
| 1205 |
+
<select class="bg-gray-600 text-white text-sm rounded px-2 py-1">
|
| 1206 |
+
<option>EUR/USD</option>
|
| 1207 |
+
<option>USD/JPY</option>
|
| 1208 |
+
<option>GBP/USD</option>
|
| 1209 |
+
<option>XAU/USD</option>
|
| 1210 |
+
</select>
|
| 1211 |
+
</div>
|
| 1212 |
+
</div>
|
| 1213 |
+
<div class="grid grid-cols-2 gap-2 mb-3">
|
| 1214 |
+
<button class="bg-green-600 hover:bg-green-700 py-2 rounded font-medium">
|
| 1215 |
+
BUY
|
| 1216 |
+
</button>
|
| 1217 |
+
<button class="bg-red-600 hover:bg-red-700 py-2 rounded font-medium">
|
| 1218 |
+
SELL
|
| 1219 |
+
</button>
|
| 1220 |
+
</div>
|
| 1221 |
+
<div class="space-y-2 text-sm">
|
| 1222 |
+
<div>
|
| 1223 |
+
<label class="block text-gray-400 mb-1">Amount</label>
|
| 1224 |
+
<div class="relative">
|
| 1225 |
+
<input type="number" class="w-full bg-gray-600 border border-gray-500 rounded px-3 py-1" value="1.00">
|
| 1226 |
+
<span class="absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400">LOT</span>
|
| 1227 |
+
</div>
|
| 1228 |
+
</div>
|
| 1229 |
+
<div class="grid grid-cols-2 gap-2">
|
| 1230 |
+
<div>
|
| 1231 |
+
<label class="block text-gray-400 mb-1">Take Profit</label>
|
| 1232 |
+
<input type="number" class="w-full bg-gray-600 border border-gray-500 rounded px-3 py-1" value="1.1025">
|
| 1233 |
+
</div>
|
| 1234 |
+
<div>
|
| 1235 |
+
<label class="block text-gray-400 mb-1">Stop Loss</label>
|
| 1236 |
+
<input type="number" class="w-full bg-gray-600 border border-gray-500 rounded px-3 py-1" value="1.0950">
|
| 1237 |
+
</div>
|
| 1238 |
+
</div>
|
| 1239 |
+
</div>
|
| 1240 |
+
<button class="w-full bg-blue-600 hover:bg-blue-700 py-2 rounded font-medium mt-3">
|
| 1241 |
+
Execute Trade
|
| 1242 |
+
</button>
|
| 1243 |
+
</div>
|
| 1244 |
+
<div class="bg-gray-700 rounded-lg p-4">
|
| 1245 |
+
<h3 class="font-medium mb-3">Active Trades</h3>
|
| 1246 |
+
<div class="space-y-3 text-sm">
|
| 1247 |
+
${trades.active_trades.map(trade => `
|
| 1248 |
+
<div class="flex justify-between items-center p-2 bg-gray-600 rounded">
|
| 1249 |
+
<div>
|
| 1250 |
+
<p class="font-medium">${trade.pair}</p>
|
| 1251 |
+
<p class="text-gray-400">${trade.direction} @ ${trade.entry}</p>
|
| 1252 |
+
</div>
|
| 1253 |
+
<div class="text-right">
|
| 1254 |
+
<p class="${trade.pnl >= 0 ? 'text-green-500' : 'text-red-500'}">${trade.pnl >= 0 ? '+' : ''}${trade.pnl}%</p>
|
| 1255 |
+
<p class="text-gray-400">${trade.current}</p>
|
| 1256 |
+
</div>
|
| 1257 |
+
</div>
|
| 1258 |
+
`).join('')}
|
| 1259 |
+
</div>
|
| 1260 |
+
<div class="mt-3">
|
| 1261 |
+
<div class="flex justify-between text-sm mb-1">
|
| 1262 |
+
<span class="text-gray-400">Total P&L</span>
|
| 1263 |
+
<span class="text-green-500">+$${trades.total_pnl.toFixed(2)}</span>
|
| 1264 |
+
</div>
|
| 1265 |
+
<div class="w-full bg-gray-600 rounded-full h-1.5">
|
| 1266 |
+
<div class="bg-green-500 h-1.5 rounded-full" style="width: 65%"></div>
|
| 1267 |
+
</div>
|
| 1268 |
+
</div>
|
| 1269 |
+
</div>
|
| 1270 |
+
`;
|
| 1271 |
+
|
| 1272 |
+
document.getElementById('trade-execution').innerHTML = executionHTML;
|
| 1273 |
+
|
| 1274 |
+
// Update timestamp
|
| 1275 |
+
updateTimestamp();
|
| 1276 |
+
} catch (error) {
|
| 1277 |
+
console.error('Error loading trade execution:', error);
|
| 1278 |
+
document.getElementById('trade-execution').innerHTML = `
|
| 1279 |
+
<div class="bg-gray-700 rounded-lg p-4 text-center text-red-400">
|
| 1280 |
+
<i class="fas fa-exclamation-triangle mr-2"></i> Failed to load trade data
|
| 1281 |
+
</div>
|
| 1282 |
+
`;
|
| 1283 |
+
}
|
| 1284 |
+
}
|
| 1285 |
+
|
| 1286 |
+
// Load AI insights
|
| 1287 |
+
async function loadAIInsights() {
|
| 1288 |
+
try {
|
| 1289 |
+
// In a real app, you would fetch from your API
|
| 1290 |
+
// const response = await axios.get(`${BASE_URL}/insights?symbol=${currentPair}&api_key=${API_KEY}`);
|
| 1291 |
+
|
| 1292 |
+
// Simulated response with realistic data
|
| 1293 |
+
const simulatedResponse = {
|
| 1294 |
+
data: {
|
| 1295 |
+
outlook: "The EUR/USD pair is showing strong bullish momentum with confirmation from both technical and fundamental factors. Technical indicators show a bullish flag pattern with RSI in healthy territory (62.4). Fundamentally, expectations of a Fed pause and ECB tightening bias support further EUR gains. AI confidence in this setup is 87%.",
|
| 1296 |
+
technical_summary: [
|
| 1297 |
+
"Bullish EMA crossover (10 > 20 > 50)",
|
| 1298 |
+
"Price above key Fibonacci level (1.0950)",
|
| 1299 |
+
"Volume confirms upward momentum",
|
| 1300 |
+
"Watch for resistance at 1.1025 (R1)"
|
| 1301 |
+
],
|
| 1302 |
+
fundamental_summary: [
|
| 1303 |
+
"Fed expected to pause rate hikes",
|
| 1304 |
+
"Eurozone core inflation remains elevated",
|
| 1305 |
+
"Risk sentiment improving (supporting EUR)",
|
| 1306 |
+
"Monitor US NFP data tomorrow"
|
| 1307 |
+
],
|
| 1308 |
+
entry_zones: {
|
| 1309 |
+
primary: "1.0970 - 1.0980",
|
| 1310 |
+
secondary: "1.0950 - 1.0960"
|
| 1311 |
+
},
|
| 1312 |
+
risk_assessment: {
|
| 1313 |
+
reward_risk: 3.2,
|
| 1314 |
+
probability: 72,
|
| 1315 |
+
expected_move: "+75 pips / -25 pips",
|
| 1316 |
+
risk_level: 30
|
| 1317 |
+
}
|
| 1318 |
+
}
|
| 1319 |
+
};
|
| 1320 |
+
|
| 1321 |
+
const insights = simulatedResponse.data;
|
| 1322 |
+
let insightsHTML = `
|
| 1323 |
+
<div class="bg-gray-700 rounded-lg p-4 mb-4">
|
| 1324 |
+
<div class="flex items-start">
|
| 1325 |
+
<div class="bg-blue-500 p-2 rounded-full mr-3">
|
| 1326 |
+
<i class="fas fa-brain text-white"></i>
|
| 1327 |
+
</div>
|
| 1328 |
+
<div>
|
| 1329 |
+
<h3 class="font-medium mb-2">Market Outlook</h3>
|
| 1330 |
+
<p class="text-sm text-gray-300">
|
| 1331 |
+
${insights.outlook}
|
| 1332 |
+
</p>
|
| 1333 |
+
</div>
|
| 1334 |
+
</div>
|
| 1335 |
+
</div>
|
| 1336 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
| 1337 |
+
<div class="bg-gray-700 rounded-lg p-4">
|
| 1338 |
+
<h3 class="font-medium mb-2">Technical Summary</h3>
|
| 1339 |
+
<ul class="text-sm space-y-2 text-gray-300">
|
| 1340 |
+
${insights.technical_summary.map(item => `
|
| 1341 |
+
<li class="flex items-start">
|
| 1342 |
+
<i class="fas fa-check-circle ${item.includes('Watch') ? 'text-yellow-500' : 'text-green-500'} mr-2 mt-1"></i>
|
| 1343 |
+
<span>${item}</span>
|
| 1344 |
+
</li>
|
| 1345 |
+
`).join('')}
|
| 1346 |
+
</ul>
|
| 1347 |
+
</div>
|
| 1348 |
+
<div class="bg-gray-700 rounded-lg p-4">
|
| 1349 |
+
<h3 class="font-medium mb-2">Fundamental Summary</h3>
|
| 1350 |
+
<ul class="text-sm space-y-2 text-gray-300">
|
| 1351 |
+
${insights.fundamental_summary.map(item => `
|
| 1352 |
+
<li class="flex items-start">
|
| 1353 |
+
<i class="fas fa-check-circle ${item.includes('Monitor') ? 'text-yellow-500' : 'text-green-500'} mr-2 mt-1"></i>
|
| 1354 |
+
<span>${item}</span>
|
| 1355 |
+
</li>
|
| 1356 |
+
`).join('')}
|
| 1357 |
+
</ul>
|
| 1358 |
+
</div>
|
| 1359 |
+
<div class="bg-gray-700 rounded-lg p-4">
|
| 1360 |
+
<h3 class="font-medium mb-2">Optimal Entry Zones</h3>
|
| 1361 |
+
<div class="flex items-center justify-between text-sm mb-2">
|
| 1362 |
+
<span class="text-gray-400">Primary</span>
|
| 1363 |
+
<span>${insights.entry_zones.primary}</span>
|
| 1364 |
+
<span class="text-green-500">Current</span>
|
| 1365 |
+
</div>
|
| 1366 |
+
<div class="flex items-center justify-between text-sm mb-2">
|
| 1367 |
+
<span class="text-gray-400">Secondary</span>
|
| 1368 |
+
<span>${insights.entry_zones.secondary}</span>
|
| 1369 |
+
<span class="text-gray-400">Wait</span>
|
| 1370 |
+
</div>
|
| 1371 |
+
<div class="w-full bg-gray-600 rounded-full h-2 mt-2">
|
| 1372 |
+
<div class="bg-gradient-to-r from-green-500 to-blue-500 h-2 rounded-full" style="width: 85%"></div>
|
| 1373 |
+
</div>
|
| 1374 |
+
</div>
|
| 1375 |
+
<div class="bg-gray-700 rounded-lg p-4">
|
| 1376 |
+
<h3 class="font-medium mb-2">Risk Assessment</h3>
|
| 1377 |
+
<div class="flex justify-between text-sm mb-1">
|
| 1378 |
+
<span class="text-gray-400">Reward/Risk Ratio</span>
|
| 1379 |
+
<span>${insights.risk_assessment.reward_risk}:1</span>
|
| 1380 |
+
</div>
|
| 1381 |
+
<div class="flex justify-between text-sm mb-1">
|
| 1382 |
+
<span class="text-gray-400">Probability of Success</span>
|
| 1383 |
+
<span>${insights.risk_assessment.probability}%</span>
|
| 1384 |
+
</div>
|
| 1385 |
+
<div class="flex justify-between text-sm mb-1">
|
| 1386 |
+
<span class="text-gray-400">Expected Move</span>
|
| 1387 |
+
<span>${insights.risk_assessment.expected_move}</span>
|
| 1388 |
+
</div>
|
| 1389 |
+
<div class="mt-2">
|
| 1390 |
+
<div class="flex justify-between text-xs text-gray-400 mb-1">
|
| 1391 |
+
<span>Low Risk</span>
|
| 1392 |
+
<span>High Risk</span>
|
| 1393 |
+
</div>
|
| 1394 |
+
<div class="w-full bg-gray-600 rounded-full h-1.5">
|
| 1395 |
+
<div class="bg-green-500 h-1.5 rounded-full" style="width: ${insights.risk_assessment.risk_level}%"></div>
|
| 1396 |
+
</div>
|
| 1397 |
+
</div>
|
| 1398 |
+
</div>
|
| 1399 |
+
</div>
|
| 1400 |
+
`;
|
| 1401 |
+
|
| 1402 |
+
document.getElementById('ai-insights').innerHTML = insightsHTML;
|
| 1403 |
+
|
| 1404 |
+
// Update timestamp
|
| 1405 |
+
updateTimestamp();
|
| 1406 |
+
} catch (error) {
|
| 1407 |
+
console.error('Error loading AI insights:', error);
|
| 1408 |
+
document.getElementById('ai-insights').innerHTML = `
|
| 1409 |
+
<div class="bg-gray-700 rounded-lg p-4 text-center text-red-400">
|
| 1410 |
+
<i class="fas fa-exclamation-triangle mr-2"></i> Failed to load AI insights
|
| 1411 |
+
</div>
|
| 1412 |
+
`;
|
| 1413 |
+
}
|
| 1414 |
+
}
|
| 1415 |
+
|
| 1416 |
+
// Update news ticker
|
| 1417 |
+
async function updateNewsTicker() {
|
| 1418 |
+
try {
|
| 1419 |
+
// In a real app, you would fetch from a news API
|
| 1420 |
+
// const response = await axios.get(`${BASE_URL}/news?api_key=${API_KEY}`);
|
| 1421 |
+
|
| 1422 |
+
// Simulated news items
|
| 1423 |
+
const newsItems = [
|
| 1424 |
+
"USD: Fed signals potential rate pause in June",
|
| 1425 |
+
"EUR: ECB President Lagarde hints at further tightening",
|
| 1426 |
+
"GBP: UK inflation falls more than expected to 6.8%",
|
| 1427 |
+
"JPY: BOJ maintains ultra-loose policy, yen weakens",
|
| 1428 |
+
"Gold prices rise amid banking sector concerns"
|
| 1429 |
+
];
|
| 1430 |
+
|
| 1431 |
+
const tickerContent = newsItems.map(item => `<span class="mr-8">${item} | </span>`).join('');
|
| 1432 |
+
document.getElementById('news-ticker').innerHTML = tickerContent;
|
| 1433 |
+
} catch (error) {
|
| 1434 |
+
console.error('Error updating news ticker:', error);
|
| 1435 |
+
document.getElementById('news-ticker').innerHTML = 'Market news currently unavailable';
|
| 1436 |
+
}
|
| 1437 |
+
}
|
| 1438 |
+
|
| 1439 |
+
// Update dashboard timestamp
|
| 1440 |
+
function updateTimestamp() {
|
| 1441 |
+
const now = new Date();
|
| 1442 |
+
document.getElementById('last-update').textContent = now.toLocaleTimeString();
|
| 1443 |
+
}
|
| 1444 |
+
|
| 1445 |
+
// Update all dashboard components
|
| 1446 |
+
function updateDashboard() {
|
| 1447 |
+
loadMarketData();
|
| 1448 |
+
loadMainChartData();
|
| 1449 |
+
loadTradingSignals();
|
| 1450 |
+
loadTechnicalAnalysis();
|
| 1451 |
+
loadFundamentalAnalysis();
|
| 1452 |
+
loadRiskManagement();
|
| 1453 |
+
loadTradeExecution();
|
| 1454 |
+
loadAIInsights();
|
| 1455 |
+
updateNewsTicker();
|
| 1456 |
+
}
|
| 1457 |
+
|
| 1458 |
+
// Helper function to generate random chart data
|
| 1459 |
+
function generateRandomChartData(count, volatility, base = 1.0) {
|
| 1460 |
+
const data = [];
|
| 1461 |
+
let current = base;
|
| 1462 |
+
|
| 1463 |
+
for (let i = 0; i < count; i++) {
|
| 1464 |
+
// Add some randomness with slight upward bias
|
| 1465 |
+
const change = (Math.random() - 0.3) * volatility;
|
| 1466 |
+
current += change;
|
| 1467 |
+
data.push(current);
|
| 1468 |
+
}
|
| 1469 |
+
|
| 1470 |
+
return data;
|
| 1471 |
+
}
|
| 1472 |
+
</script>
|
| 1473 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - <a href="https://enzostvs-deepsite.hf.space?remix=Raven710/basic-frame-trade-bot" style="color: #fff;text-decoration: underline;" target="_blank" >🧬 Remix</a></p></body>
|
| 1474 |
+
</html>
|