vnsavitri's picture
Add 2 files
4344ea3 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI Stock Trading Agent</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.compact-table th, .compact-table td {
padding: 0.5rem 0.75rem;
}
.symbol-cell {
min-width: 80px;
}
.action-cell {
min-width: 90px;
}
.confidence-cell {
min-width: 100px;
}
.rationale-cell {
max-width: 200px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
@media (max-width: 768px) {
.rationale-cell {
max-width: 120px;
}
}
.blink {
animation: blink-animation 1s steps(5, start) infinite;
}
@keyframes blink-animation {
to { opacity: 0.5; }
}
.gradient-bg {
background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
}
.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);
}
.sentiment-positive {
background-color: rgba(16, 185, 129, 0.1);
border-left: 4px solid #10b981;
}
.sentiment-negative {
background-color: rgba(239, 68, 68, 0.1);
border-left: 4px solid #ef4444;
}
.sentiment-neutral {
background-color: rgba(59, 130, 246, 0.1);
border-left: 4px solid #3b82f6;
}
.scrollbar-hide::-webkit-scrollbar {
display: none;
}
</style>
</head>
<body class="bg-gray-100 font-sans">
<div class="min-h-screen flex flex-col">
<!-- Header -->
<header class="gradient-bg text-white shadow-lg">
<div class="container mx-auto px-4 py-4">
<div class="flex justify-between items-center">
<div class="flex items-center space-x-2">
<i class="fas fa-robot text-2xl"></i>
<h1 class="text-xl md:text-2xl font-bold">AI Stock Trading Agent</h1>
</div>
<div class="flex items-center space-x-2 md:space-x-4">
<div class="flex items-center bg-blue-900/50 px-2 py-1 rounded-full text-xs md:text-sm">
<span class="h-2 w-2 bg-green-400 rounded-full mr-1 blink"></span>
<span>Live Data</span>
</div>
<div class="text-xs md:text-sm">
<span id="current-time" class="font-mono"></span>
</div>
</div>
</div>
</div>
</header>
<!-- Main Content -->
<main class="flex-grow container mx-auto px-2 md:px-4 py-4">
<div class="grid grid-cols-1 lg:grid-cols-4 gap-4">
<!-- Left Sidebar (hidden on mobile) -->
<div class="lg:col-span-1 space-y-4 hidden md:block">
<!-- Portfolio Summary -->
<div class="bg-white rounded-xl shadow-md p-4 card-hover transition-all duration-300">
<h2 class="text-base md:text-lg font-semibold mb-2 flex items-center">
<i class="fas fa-wallet mr-2 text-blue-600 text-sm md:text-base"></i>
Portfolio Summary
</h2>
<div class="space-y-2">
<div>
<p class="text-gray-500 text-xs md:text-sm">Total Value</p>
<p class="text-xl md:text-2xl font-bold">$128,743.28</p>
</div>
<div class="flex justify-between text-xs md:text-sm">
<div>
<p class="text-gray-500">Today's Change</p>
<p class="text-green-500 font-semibold">+$1,284.32 (1.01%)</p>
</div>
<div>
<p class="text-gray-500">YTD Return</p>
<p class="text-green-500 font-semibold">+12.4%</p>
</div>
</div>
<div class="pt-2 border-t border-gray-200">
<p class="text-gray-500 text-xs md:text-sm">Risk Profile</p>
<div class="flex items-center mt-1">
<div class="w-full bg-gray-200 rounded-full h-2">
<div class="bg-blue-600 h-2 rounded-full" style="width: 70%"></div>
</div>
<span class="ml-2 text-xs md:text-sm font-medium">Moderate-Aggressive</span>
</div>
</div>
</div>
</div>
<!-- Market Indicators -->
<div class="bg-white rounded-xl shadow-md p-4 card-hover transition-all duration-300">
<h2 class="text-base md:text-lg font-semibold mb-2 flex items-center">
<i class="fas fa-chart-line mr-2 text-blue-600 text-sm md:text-base"></i>
Market Indicators
</h2>
<div class="space-y-2 text-xs md:text-sm">
<div class="flex justify-between items-center">
<div>
<p class="text-gray-500">S&P 500</p>
<p class="font-semibold">4,567.23</p>
</div>
<span class="text-green-500">+0.78%</span>
</div>
<div class="flex justify-between items-center">
<div>
<p class="text-gray-500">NASDAQ</p>
<p class="font-semibold">14,328.45</p>
</div>
<span class="text-green-500">+1.23%</span>
</div>
<div class="flex justify-between items-center">
<div>
<p class="text-gray-500">DOW</p>
<p class="font-semibold">34,567.89</p>
</div>
<span class="text-red-500">-0.12%</span>
</div>
<div class="flex justify-between items-center">
<div>
<p class="text-gray-500">VIX</p>
<p class="font-semibold">16.23</p>
</div>
<span class="text-red-500">-2.45%</span>
</div>
</div>
</div>
</div>
<!-- Main Dashboard -->
<div class="lg:col-span-3 space-y-4">
<!-- AI Recommendations -->
<div class="bg-white rounded-xl shadow-md p-4 card-hover transition-all duration-300">
<div class="flex justify-between items-center mb-2">
<h2 class="text-base md:text-lg font-semibold flex items-center">
<i class="fas fa-lightbulb mr-2 text-blue-600 text-sm md:text-base"></i>
AI Trading Recommendations
</h2>
<div class="text-xs md:text-sm text-gray-500">
Updated: <span id="last-updated">Just now</span>
</div>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200 compact-table text-xs md:text-sm">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-2 py-2 text-left font-medium text-gray-500 uppercase tracking-wider symbol-cell">Symbol</th>
<th scope="col" class="px-2 py-2 text-left font-medium text-gray-500 uppercase tracking-wider">Position</th>
<th scope="col" class="px-2 py-2 text-left font-medium text-gray-500 uppercase tracking-wider action-cell">Action</th>
<th scope="col" class="px-2 py-2 text-left font-medium text-gray-500 uppercase tracking-wider confidence-cell">Confidence</th>
<th scope="col" class="px-2 py-2 text-left font-medium text-gray-500 uppercase tracking-wider rationale-cell">Rationale</th>
<th scope="col" class="px-2 py-2 text-left font-medium text-gray-500 uppercase tracking-wider"></th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-2 py-2 whitespace-nowrap symbol-cell">
<div class="flex items-center">
<div class="flex-shrink-0 h-8 w-8 bg-blue-100 rounded-full flex items-center justify-center text-xs">
<span class="text-blue-600 font-semibold">AAPL</span>
</div>
<div class="ml-2">
<div class="font-medium">Apple</div>
<div class="text-gray-500">100 sh</div>
</div>
</div>
</td>
<td class="px-2 py-2 whitespace-nowrap">
<div class="font-medium">$18,245</div>
<div class="text-gray-500">14.2%</div>
</td>
<td class="px-2 py-2 whitespace-nowrap action-cell">
<span class="px-2 inline-flex leading-5 font-semibold rounded-full bg-green-100 text-green-800 text-xs">
Buy More
</span>
</td>
<td class="px-2 py-2 whitespace-nowrap confidence-cell">
<div class="flex items-center">
<div class="w-full bg-gray-200 rounded-full h-1.5">
<div class="bg-green-600 h-1.5 rounded-full" style="width: 85%"></div>
</div>
<span class="ml-1 font-medium">85%</span>
</div>
</td>
<td class="px-2 py-2 text-gray-500 rationale-cell" title="Strong earnings beat, positive sentiment from product launch rumors, technical breakout above resistance.">
Strong earnings beat, positive sentiment from product launch...
</td>
<td class="px-2 py-2 whitespace-nowrap text-right font-medium">
<button class="text-blue-600 hover:text-blue-900 text-xs md:text-sm">Details</button>
</td>
</tr>
<tr>
<td class="px-2 py-2 whitespace-nowrap symbol-cell">
<div class="flex items-center">
<div class="flex-shrink-0 h-8 w-8 bg-blue-100 rounded-full flex items-center justify-center text-xs">
<span class="text-blue-600 font-semibold">TSLA</span>
</div>
<div class="ml-2">
<div class="font-medium">Tesla</div>
<div class="text-gray-500">50 sh</div>
</div>
</div>
</td>
<td class="px-2 py-2 whitespace-nowrap">
<div class="font-medium">$12,345</div>
<div class="text-gray-500">9.6%</div>
</td>
<td class="px-2 py-2 whitespace-nowrap action-cell">
<span class="px-2 inline-flex leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800 text-xs">
Hold
</span>
</td>
<td class="px-2 py-2 whitespace-nowrap confidence-cell">
<div class="flex items-center">
<div class="w-full bg-gray-200 rounded-full h-1.5">
<div class="bg-yellow-400 h-1.5 rounded-full" style="width: 65%"></div>
</div>
<span class="ml-1 font-medium">65%</span>
</div>
</td>
<td class="px-2 py-2 text-gray-500 rationale-cell" title="Mixed sentiment - positive delivery numbers offset by CEO controversy on social media. Waiting for clearer trend.">
Mixed sentiment - positive delivery numbers offset by CEO...
</td>
<td class="px-2 py-2 whitespace-nowrap text-right font-medium">
<button class="text-blue-600 hover:text-blue-900 text-xs md:text-sm">Details</button>
</td>
</tr>
<tr>
<td class="px-2 py-2 whitespace-nowrap symbol-cell">
<div class="flex items-center">
<div class="flex-shrink-0 h-8 w-8 bg-blue-100 rounded-full flex items-center justify-center text-xs">
<span class="text-blue-600 font-semibold">ARKK</span>
</div>
<div class="ml-2">
<div class="font-medium">ARK ETF</div>
<div class="text-gray-500">75 sh</div>
</div>
</div>
</td>
<td class="px-2 py-2 whitespace-nowrap">
<div class="font-medium">$3,456</div>
<div class="text-gray-500">2.7%</div>
</td>
<td class="px-2 py-2 whitespace-nowrap action-cell">
<span class="px-2 inline-flex leading-5 font-semibold rounded-full bg-red-100 text-red-800 text-xs">
Sell
</span>
</td>
<td class="px-2 py-2 whitespace-nowrap confidence-cell">
<div class="flex items-center">
<div class="w-full bg-gray-200 rounded-full h-1.5">
<div class="bg-red-600 h-1.5 rounded-full" style="width: 72%"></div>
</div>
<span class="ml-1 font-medium">72%</span>
</div>
</td>
<td class="px-2 py-2 text-gray-500 rationale-cell" title="Rising interest rate environment negatively impacts growth stocks. Reddit sentiment turning bearish.">
Rising interest rates impact growth stocks. Reddit sentiment...
</td>
<td class="px-2 py-2 whitespace-nowrap text-right font-medium">
<button class="text-blue-600 hover:text-blue-900 text-xs md:text-sm">Details</button>
</td>
</tr>
<tr>
<td class="px-2 py-2 whitespace-nowrap symbol-cell">
<div class="flex items-center">
<div class="flex-shrink-0 h-8 w-8 bg-blue-100 rounded-full flex items-center justify-center text-xs">
<span class="text-blue-600 font-semibold">NVDA</span>
</div>
<div class="ml-2">
<div class="font-medium">Nvidia</div>
<div class="text-gray-500">30 sh</div>
</div>
</div>
</td>
<td class="px-2 py-2 whitespace-nowrap">
<div class="font-medium">$15,678</div>
<div class="text-gray-500">12.2%</div>
</td>
<td class="px-2 py-2 whitespace-nowrap action-cell">
<span class="px-2 inline-flex leading-5 font-semibold rounded-full bg-green-100 text-green-800 text-xs">
Buy
</span>
</td>
<td class="px-2 py-2 whitespace-nowrap confidence-cell">
<div class="flex items-center">
<div class="w-full bg-gray-200 rounded-full h-1.5">
<div class="bg-green-600 h-1.5 rounded-full" style="width: 88%"></div>
</div>
<span class="ml-1 font-medium">88%</span>
</div>
</td>
<td class="px-2 py-2 text-gray-500 rationale-cell" title="AI chip demand surging, multiple price target increases from analysts, strong technical momentum.">
AI chip demand surging, multiple price target increases...
</td>
<td class="px-2 py-2 whitespace-nowrap text-right font-medium">
<button class="text-blue-600 hover:text-blue-900 text-xs md:text-sm">Details</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Market Sentiment & News -->
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<!-- Market Sentiment -->
<div class="bg-white rounded-xl shadow-md p-4 card-hover transition-all duration-300">
<h2 class="text-base md:text-lg font-semibold mb-2 flex items-center">
<i class="fas fa-comment-dots mr-2 text-blue-600 text-sm md:text-base"></i>
Market Sentiment
</h2>
<div class="space-y-3 max-h-64 overflow-y-auto scrollbar-hide text-xs md:text-sm">
<div class="p-2 rounded-lg sentiment-positive">
<div class="flex justify-between items-start">
<div class="font-medium">AAPL</div>
<div class="text-gray-500">Twitter • 12m</div>
</div>
<p class="mt-1">"Apple's AR headset rumors gaining traction..."</p>
<div class="flex justify-between items-center mt-1">
<span class="text-green-600">Positive (0.82)</span>
<div class="flex space-x-1">
<span class="bg-green-100 text-green-800 px-1 rounded">Tech</span>
</div>
</div>
</div>
<div class="p-2 rounded-lg sentiment-negative">
<div class="flex justify-between items-start">
<div class="font-medium">TSLA</div>
<div class="text-gray-500">Reddit • 25m</div>
</div>
<p class="mt-1">"Elon's latest tweet about Fed rates causing..."</p>
<div class="flex justify-between items-center mt-1">
<span class="text-red-600">Negative (0.67)</span>
<div class="flex space-x-1">
<span class="bg-red-100 text-red-800 px-1 rounded">CEO</span>
</div>
</div>
</div>
<div class="p-2 rounded-lg sentiment-neutral">
<div class="flex justify-between items-start">
<div class="font-medium">Market</div>
<div class="text-gray-500">Bloomberg • 42m</div>
</div>
<p class="mt-1">"Fed minutes show divided opinions on rate..."</p>
<div class="flex justify-between items-center mt-1">
<span class="text-blue-600">Neutral (0.45)</span>
<div class="flex space-x-1">
<span class="bg-yellow-100 text-yellow-800 px-1 rounded">Macro</span>
</div>
</div>
</div>
</div>
</div>
<!-- News Alerts -->
<div class="bg-white rounded-xl shadow-md p-4 card-hover transition-all duration-300">
<h2 class="text-base md:text-lg font-semibold mb-2 flex items-center">
<i class="fas fa-newspaper mr-2 text-blue-600 text-sm md:text-base"></i>
News Alerts
</h2>
<div class="space-y-3 max-h-64 overflow-y-auto scrollbar-hide text-xs md:text-sm">
<div class="border-l-4 border-blue-500 pl-2 py-1">
<div class="flex justify-between items-start">
<h3 class="font-medium">Inflation Data Surprise</h3>
<span class="text-gray-500">2:15 PM</span>
</div>
<p class="text-gray-600 mt-1">CPI comes in lower than expected at 3.2% vs 3.4% estimate.</p>
</div>
<div class="border-l-4 border-green-500 pl-2 py-1">
<div class="flex justify-between items-start">
<h3 class="font-medium">AAPL Supplier News</h3>
<span class="text-gray-500">1:30 PM</span>
</div>
<p class="text-gray-600 mt-1">Key supplier reports strong orders for premium components.</p>
</div>
<div class="border-l-4 border-red-500 pl-2 py-1">
<div class="flex justify-between items-start">
<h3 class="font-medium">Bank Sector Warning</h3>
<span class="text-gray-500">12:45 PM</span>
</div>
<p class="text-gray-600 mt-1">Regulator flags concerns about commercial real estate exposure.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<!-- Footer -->
<footer class="bg-gray-800 text-white py-4 text-xs md:text-sm">
<div class="container mx-auto px-4">
<div class="flex flex-col md:flex-row justify-between items-center">
<div class="mb-2 md:mb-0">
<p>AI Stock Trading Agent • v2.4.1</p>
<p class="text-gray-400 mt-1">Data updates every 15 seconds</p>
</div>
<div class="flex space-x-3 md:space-x-6">
<button class="text-gray-300 hover:text-white transition duration-200">
<i class="fas fa-cog"></i> Settings
</button>
<button class="text-gray-300 hover:text-white transition duration-200">
<i class="fas fa-question-circle"></i> Help
</button>
</div>
</div>
</div>
</footer>
</div>
<script>
// Update current time
function updateTime() {
const now = new Date();
const timeString = now.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit' });
document.getElementById('current-time').textContent = timeString;
}
setInterval(updateTime, 1000);
updateTime();
// Simulate data updates
setInterval(() => {
// Update last updated time
const now = new Date();
const options = { hour: '2-digit', minute: '2-digit' };
document.getElementById('last-updated').textContent = now.toLocaleTimeString('en-US', options);
// Randomly update some numbers to simulate live data
const portfolioValue = document.querySelector('.text-xl.md\\:text-2xl.font-bold');
const currentValue = parseFloat(portfolioValue.textContent.replace(/[^0-9.-]+/g,""));
const change = (Math.random() - 0.4) * 0.2;
const newValue = currentValue * (1 + change / 100);
portfolioValue.textContent = '$' + newValue.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
const todayChange = document.querySelector('.text-green-500.font-semibold');
const todayValue = parseFloat(todayChange.textContent.match(/[+-]?\d+(\.\d+)?/)[0]);
const todayNewValue = todayValue + (Math.random() - 0.5) * 0.2;
todayChange.textContent = '+' + todayNewValue.toFixed(2) + '%';
}, 15000);
</script>
<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=vnsavitri/ai-stock-trading-agent" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>