Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>TradeOracle - Real-Time P&L Calculator</title> | |
| <link rel="icon" type="image/x-icon" href="/static/favicon.ico"> | |
| <link rel="stylesheet" href="style.css"> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> | |
| <script src="https://unpkg.com/feather-icons"></script> | |
| </head> | |
| <body class="dark bg-gray-900 text-white min-h-screen"> | |
| <custom-navbar></custom-navbar> | |
| <main class="container mx-auto px-4 py-8 max-w-7xl"> | |
| <div class="mb-8 text-center"> | |
| <h1 class="text-4xl font-bold mb-2 bg-gradient-to-r from-blue-400 to-purple-500 bg-clip-text text-transparent"> | |
| TradeOracle P&L Calculator | |
| </h1> | |
| <p class="text-gray-400">Real-time profit/loss calculations with live market data</p> | |
| </div> | |
| <div class="grid grid-cols-1 lg:grid-cols-3 gap-6"> | |
| <!-- Market Data Section --> | |
| <section class="lg:col-span-1"> | |
| <div class="bg-gray-800 rounded-xl p-6 border border-gray-700"> | |
| <h2 class="text-xl font-semibold mb-4 flex items-center"> | |
| <i data-feather="trending-up" class="mr-2 text-blue-400"></i> | |
| Market Data | |
| </h2> | |
| <div class="mb-4"> | |
| <label class="block text-sm font-medium mb-2">Stock Symbol</label> | |
| <input type="text" id="stockSymbol" placeholder="RELIANCE" | |
| class="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-lg focus:outline-none focus:border-blue-500 transition-colors"> | |
| </div> | |
| <div class="mb-4"> | |
| <label class="block text-sm font-medium mb-2">Date</label> | |
| <input type="date" id="marketDate" | |
| class="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-lg focus:outline-none focus:border-blue-500 transition-colors"> | |
| </div> | |
| <button id="fetchDataBtn" | |
| class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-lg transition-colors flex items-center justify-center"> | |
| <i data-feather="download" class="mr-2"></i> | |
| Fetch Market Data | |
| </button> | |
| <div id="marketInfo" class="mt-6 hidden"> | |
| <div class="bg-gray-700 rounded-lg p-4"> | |
| <div class="flex justify-between items-center mb-2"> | |
| <span class="text-gray-400">Current Price:</span> | |
| <span id="currentPrice" class="text-2xl font-bold text-green-400">₹0.00</span> | |
| </div> | |
| <div class="flex justify-between items-center"> | |
| <span class="text-gray-400">Last Updated:</span> | |
| <span id="lastUpdated" class="text-sm text-gray-300">-</span> | |
| </div> | |
| </div> | |
| <div id="priceSliderSection" class="mt-4"> | |
| <label class="block text-sm font-medium mb-2">Price Selection</label> | |
| <input type="range" id="priceSlider" min="0" max="2000" step="0.1" | |
| class="w-full h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer"> | |
| <input type="number" id="priceInput" step="0.1" | |
| class="w-full mt-2 px-3 py-2 bg-gray-700 border border-gray-600 rounded-lg focus:outline-none focus:border-blue-500 transition-colors"> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Trades Section --> | |
| <section class="lg:col-span-2"> | |
| <div class="bg-gray-800 rounded-xl p-6 border border-gray-700"> | |
| <div class="flex justify-between items-center mb-4"> | |
| <h2 class="text-xl font-semibold flex items-center"> | |
| <i data-feather="repeat" class="mr-2 text-blue-400"></i> | |
| Trades | |
| </h2> | |
| <button id="addTradeBtn" | |
| class="bg-purple-600 hover:bg-purple-700 text-white font-medium py-2 px-4 rounded-lg transition-colors flex items-center"> | |
| <i data-feather="plus" class="mr-2"></i> | |
| Add Trade | |
| </button> | |
| </div> | |
| <div id="tradesContainer" class="space-y-4"> | |
| <!-- Trades will be dynamically added here --> | |
| </div> | |
| <div id="totalPL" class="mt-6 p-4 bg-gray-700 rounded-lg text-center"> | |
| <p class="text-gray-400 mb-1">Total P&L</p> | |
| <p id="totalPLValue" class="text-3xl font-bold">₹0.00</p> | |
| </div> | |
| </div> | |
| </section> | |
| </div> | |
| </main> | |
| <script src="components/navbar.js"></script> | |
| <script src="script.js"></script> | |
| <script>feather.replace();</script> | |
| <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script> | |
| </body> | |
| </html> |