Spaces:
Running
Running
Add 2 files
Browse files- README.md +7 -5
- index.html +336 -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: simple-trading
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: blue
|
| 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,336 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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>Simple 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 |
+
<style>
|
| 10 |
+
.price-up {
|
| 11 |
+
color: #10b981;
|
| 12 |
+
animation: pulse-up 0.5s ease-in-out;
|
| 13 |
+
}
|
| 14 |
+
.price-down {
|
| 15 |
+
color: #ef4444;
|
| 16 |
+
animation: pulse-down 0.5s ease-in-out;
|
| 17 |
+
}
|
| 18 |
+
@keyframes pulse-up {
|
| 19 |
+
0% { transform: scale(1); }
|
| 20 |
+
50% { transform: scale(1.1); }
|
| 21 |
+
100% { transform: scale(1); }
|
| 22 |
+
}
|
| 23 |
+
@keyframes pulse-down {
|
| 24 |
+
0% { transform: scale(1); }
|
| 25 |
+
50% { transform: scale(0.9); }
|
| 26 |
+
100% { transform: scale(1); }
|
| 27 |
+
}
|
| 28 |
+
.chart-container {
|
| 29 |
+
height: 200px;
|
| 30 |
+
position: relative;
|
| 31 |
+
}
|
| 32 |
+
.chart-line {
|
| 33 |
+
position: absolute;
|
| 34 |
+
bottom: 0;
|
| 35 |
+
left: 0;
|
| 36 |
+
width: 100%;
|
| 37 |
+
height: 100%;
|
| 38 |
+
stroke-width: 2;
|
| 39 |
+
fill: none;
|
| 40 |
+
}
|
| 41 |
+
</style>
|
| 42 |
+
</head>
|
| 43 |
+
<body class="bg-gray-900 text-white min-h-screen">
|
| 44 |
+
<div class="container mx-auto px-4 py-8">
|
| 45 |
+
<header class="flex justify-between items-center mb-8">
|
| 46 |
+
<div class="flex items-center">
|
| 47 |
+
<i class="fas fa-robot text-3xl text-indigo-500 mr-3"></i>
|
| 48 |
+
<h1 class="text-2xl font-bold">Simple Trading Bot</h1>
|
| 49 |
+
</div>
|
| 50 |
+
<div class="flex items-center space-x-4">
|
| 51 |
+
<div class="bg-gray-800 px-4 py-2 rounded-lg">
|
| 52 |
+
<span class="text-gray-400">Balance:</span>
|
| 53 |
+
<span class="font-bold ml-2" id="balance">$10,000.00</span>
|
| 54 |
+
</div>
|
| 55 |
+
<button class="bg-indigo-600 hover:bg-indigo-700 px-4 py-2 rounded-lg transition">
|
| 56 |
+
<i class="fas fa-cog mr-2"></i>Settings
|
| 57 |
+
</button>
|
| 58 |
+
</div>
|
| 59 |
+
</header>
|
| 60 |
+
|
| 61 |
+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
| 62 |
+
<!-- Market Data -->
|
| 63 |
+
<div class="bg-gray-800 rounded-xl p-6 col-span-1 lg:col-span-2">
|
| 64 |
+
<div class="flex justify-between items-center mb-6">
|
| 65 |
+
<h2 class="text-xl font-bold">Market Data</h2>
|
| 66 |
+
<div class="flex space-x-2">
|
| 67 |
+
<select class="bg-gray-700 text-white rounded px-3 py-1">
|
| 68 |
+
<option>BTC/USD</option>
|
| 69 |
+
<option>ETH/USD</option>
|
| 70 |
+
<option>SOL/USD</option>
|
| 71 |
+
</select>
|
| 72 |
+
<select class="bg-gray-700 text-white rounded px-3 py-1">
|
| 73 |
+
<option>1m</option>
|
| 74 |
+
<option>5m</option>
|
| 75 |
+
<option>15m</option>
|
| 76 |
+
<option>1h</option>
|
| 77 |
+
<option>1d</option>
|
| 78 |
+
</select>
|
| 79 |
+
</div>
|
| 80 |
+
</div>
|
| 81 |
+
|
| 82 |
+
<div class="grid grid-cols-3 gap-4 mb-6">
|
| 83 |
+
<div class="bg-gray-700 p-4 rounded-lg">
|
| 84 |
+
<div class="text-gray-400 text-sm">Current Price</div>
|
| 85 |
+
<div class="text-2xl font-bold" id="current-price">$42,850.32</div>
|
| 86 |
+
<div class="text-sm" id="price-change">+2.34% <i class="fas fa-arrow-up ml-1"></i></div>
|
| 87 |
+
</div>
|
| 88 |
+
<div class="bg-gray-700 p-4 rounded-lg">
|
| 89 |
+
<div class="text-gray-400 text-sm">24h High</div>
|
| 90 |
+
<div class="text-2xl font-bold">$43,120.45</div>
|
| 91 |
+
</div>
|
| 92 |
+
<div class="bg-gray-700 p-4 rounded-lg">
|
| 93 |
+
<div class="text-gray-400 text-sm">24h Low</div>
|
| 94 |
+
<div class="text-2xl font-bold">$41,980.67</div>
|
| 95 |
+
</div>
|
| 96 |
+
</div>
|
| 97 |
+
|
| 98 |
+
<div class="chart-container mb-6">
|
| 99 |
+
<svg id="price-chart" width="100%" height="100%" viewBox="0 0 500 200" preserveAspectRatio="none">
|
| 100 |
+
<path class="chart-line" stroke="#8b5cf6" d="M0,200 L50,180 L100,190 L150,160 L200,170 L250,140 L300,150 L350,130 L400,120 L450,110 L500,100" />
|
| 101 |
+
</svg>
|
| 102 |
+
</div>
|
| 103 |
+
|
| 104 |
+
<div class="flex justify-between">
|
| 105 |
+
<div class="text-gray-400">Last updated: <span id="last-updated">Just now</span></div>
|
| 106 |
+
<button id="refresh-btn" class="text-indigo-400 hover:text-indigo-300 transition">
|
| 107 |
+
<i class="fas fa-sync-alt mr-1"></i>Refresh
|
| 108 |
+
</button>
|
| 109 |
+
</div>
|
| 110 |
+
</div>
|
| 111 |
+
|
| 112 |
+
<!-- Trading Panel -->
|
| 113 |
+
<div class="bg-gray-800 rounded-xl p-6">
|
| 114 |
+
<h2 class="text-xl font-bold mb-6">Trading Panel</h2>
|
| 115 |
+
|
| 116 |
+
<div class="mb-6">
|
| 117 |
+
<div class="flex justify-between mb-2">
|
| 118 |
+
<label class="text-gray-400">Amount (USD)</label>
|
| 119 |
+
<span class="text-gray-400">Available: $10,000.00</span>
|
| 120 |
+
</div>
|
| 121 |
+
<input type="number" class="w-full bg-gray-700 border border-gray-600 rounded-lg px-4 py-3 focus:outline-none focus:ring-2 focus:ring-indigo-500" placeholder="0.00" id="trade-amount">
|
| 122 |
+
</div>
|
| 123 |
+
|
| 124 |
+
<div class="grid grid-cols-2 gap-4 mb-6">
|
| 125 |
+
<button id="buy-btn" class="bg-green-600 hover:bg-green-700 py-3 rounded-lg font-bold transition flex items-center justify-center">
|
| 126 |
+
<i class="fas fa-arrow-up mr-2"></i> Buy
|
| 127 |
+
</button>
|
| 128 |
+
<button id="sell-btn" class="bg-red-600 hover:bg-red-700 py-3 rounded-lg font-bold transition flex items-center justify-center">
|
| 129 |
+
<i class="fas fa-arrow-down mr-2"></i> Sell
|
| 130 |
+
</button>
|
| 131 |
+
</div>
|
| 132 |
+
|
| 133 |
+
<div class="mb-6">
|
| 134 |
+
<h3 class="font-bold mb-3">Bot Settings</h3>
|
| 135 |
+
<div class="space-y-4">
|
| 136 |
+
<div>
|
| 137 |
+
<label class="flex items-center">
|
| 138 |
+
<input type="checkbox" class="form-checkbox h-5 w-5 text-indigo-600 rounded" checked>
|
| 139 |
+
<span class="ml-2">Auto-trading</span>
|
| 140 |
+
</label>
|
| 141 |
+
</div>
|
| 142 |
+
<div>
|
| 143 |
+
<label class="text-gray-400 block mb-1">Take Profit (%)</label>
|
| 144 |
+
<input type="number" class="w-full bg-gray-700 border border-gray-600 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500" value="5">
|
| 145 |
+
</div>
|
| 146 |
+
<div>
|
| 147 |
+
<label class="text-gray-400 block mb-1">Stop Loss (%)</label>
|
| 148 |
+
<input type="number" class="w-full bg-gray-700 border border-gray-600 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500" value="3">
|
| 149 |
+
</div>
|
| 150 |
+
</div>
|
| 151 |
+
</div>
|
| 152 |
+
|
| 153 |
+
<button class="w-full bg-indigo-600 hover:bg-indigo-700 py-3 rounded-lg font-bold transition">
|
| 154 |
+
<i class="fas fa-play mr-2"></i> Start Bot
|
| 155 |
+
</button>
|
| 156 |
+
</div>
|
| 157 |
+
</div>
|
| 158 |
+
|
| 159 |
+
<!-- Recent Trades -->
|
| 160 |
+
<div class="bg-gray-800 rounded-xl p-6 mt-6">
|
| 161 |
+
<h2 class="text-xl font-bold mb-6">Recent Trades</h2>
|
| 162 |
+
<div class="overflow-x-auto">
|
| 163 |
+
<table class="w-full">
|
| 164 |
+
<thead>
|
| 165 |
+
<tr class="text-gray-400 border-b border-gray-700">
|
| 166 |
+
<th class="pb-3 text-left">Date</th>
|
| 167 |
+
<th class="pb-3 text-left">Pair</th>
|
| 168 |
+
<th class="pb-3 text-left">Type</th>
|
| 169 |
+
<th class="pb-3 text-left">Price</th>
|
| 170 |
+
<th class="pb-3 text-left">Amount</th>
|
| 171 |
+
<th class="pb-3 text-left">Total</th>
|
| 172 |
+
<th class="pb-3 text-left">Status</th>
|
| 173 |
+
</tr>
|
| 174 |
+
</thead>
|
| 175 |
+
<tbody id="trades-table">
|
| 176 |
+
<!-- Trades will be added here by JavaScript -->
|
| 177 |
+
</tbody>
|
| 178 |
+
</table>
|
| 179 |
+
</div>
|
| 180 |
+
</div>
|
| 181 |
+
</div>
|
| 182 |
+
|
| 183 |
+
<script>
|
| 184 |
+
// Simulate price changes
|
| 185 |
+
let currentPrice = 42850.32;
|
| 186 |
+
let priceDirection = 1; // 1 for up, -1 for down
|
| 187 |
+
let balance = 10000.00;
|
| 188 |
+
let trades = [];
|
| 189 |
+
|
| 190 |
+
// DOM elements
|
| 191 |
+
const currentPriceEl = document.getElementById('current-price');
|
| 192 |
+
const priceChangeEl = document.getElementById('price-change');
|
| 193 |
+
const balanceEl = document.getElementById('balance');
|
| 194 |
+
const refreshBtn = document.getElementById('refresh-btn');
|
| 195 |
+
const buyBtn = document.getElementById('buy-btn');
|
| 196 |
+
const sellBtn = document.getElementById('sell-btn');
|
| 197 |
+
const tradeAmountEl = document.getElementById('trade-amount');
|
| 198 |
+
const tradesTableEl = document.getElementById('trades-table');
|
| 199 |
+
const lastUpdatedEl = document.getElementById('last-updated');
|
| 200 |
+
const priceChartEl = document.getElementById('price-chart');
|
| 201 |
+
|
| 202 |
+
// Format currency
|
| 203 |
+
const formatCurrency = (amount) => {
|
| 204 |
+
return '$' + amount.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
|
| 205 |
+
};
|
| 206 |
+
|
| 207 |
+
// Generate random price data for chart
|
| 208 |
+
const generateChartData = () => {
|
| 209 |
+
let points = [];
|
| 210 |
+
let y = 200;
|
| 211 |
+
for (let x = 0; x <= 500; x += 50) {
|
| 212 |
+
y = Math.max(50, Math.min(200, y + (Math.random() * 40 - 20)));
|
| 213 |
+
points.push(`${x},${y}`);
|
| 214 |
+
}
|
| 215 |
+
return points.join(' ');
|
| 216 |
+
};
|
| 217 |
+
|
| 218 |
+
// Update chart
|
| 219 |
+
const updateChart = () => {
|
| 220 |
+
const path = priceChartEl.querySelector('.chart-line');
|
| 221 |
+
path.setAttribute('d', `M${generateChartData()}`);
|
| 222 |
+
};
|
| 223 |
+
|
| 224 |
+
// Update price
|
| 225 |
+
const updatePrice = () => {
|
| 226 |
+
// Random price change
|
| 227 |
+
const change = (Math.random() * 100 - 50) * priceDirection;
|
| 228 |
+
currentPrice = Math.max(42000, Math.min(44000, currentPrice + change));
|
| 229 |
+
|
| 230 |
+
// Occasionally reverse direction
|
| 231 |
+
if (Math.random() < 0.2) {
|
| 232 |
+
priceDirection *= -1;
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
// Update UI
|
| 236 |
+
currentPriceEl.textContent = formatCurrency(currentPrice);
|
| 237 |
+
|
| 238 |
+
// Calculate percentage change
|
| 239 |
+
const changePercent = (change / (currentPrice - change) * 100).toFixed(2);
|
| 240 |
+
if (change >= 0) {
|
| 241 |
+
priceChangeEl.innerHTML = `+${changePercent}% <i class="fas fa-arrow-up ml-1"></i>`;
|
| 242 |
+
priceChangeEl.className = 'text-sm price-up';
|
| 243 |
+
currentPriceEl.className = 'text-2xl font-bold price-up';
|
| 244 |
+
} else {
|
| 245 |
+
priceChangeEl.innerHTML = `${changePercent}% <i class="fas fa-arrow-down ml-1"></i>`;
|
| 246 |
+
priceChangeEl.className = 'text-sm price-down';
|
| 247 |
+
currentPriceEl.className = 'text-2xl font-bold price-down';
|
| 248 |
+
}
|
| 249 |
+
|
| 250 |
+
// Update last updated time
|
| 251 |
+
lastUpdatedEl.textContent = new Date().toLocaleTimeString();
|
| 252 |
+
|
| 253 |
+
// Update chart
|
| 254 |
+
updateChart();
|
| 255 |
+
};
|
| 256 |
+
|
| 257 |
+
// Add trade to history
|
| 258 |
+
const addTrade = (type, amount) => {
|
| 259 |
+
const price = currentPrice;
|
| 260 |
+
const total = amount * price;
|
| 261 |
+
const date = new Date().toLocaleString();
|
| 262 |
+
const status = 'Completed';
|
| 263 |
+
|
| 264 |
+
trades.unshift({
|
| 265 |
+
date,
|
| 266 |
+
pair: 'BTC/USD',
|
| 267 |
+
type,
|
| 268 |
+
price,
|
| 269 |
+
amount,
|
| 270 |
+
total,
|
| 271 |
+
status
|
| 272 |
+
});
|
| 273 |
+
|
| 274 |
+
// Update balance
|
| 275 |
+
if (type === 'Buy') {
|
| 276 |
+
balance -= total;
|
| 277 |
+
} else {
|
| 278 |
+
balance += total;
|
| 279 |
+
}
|
| 280 |
+
balanceEl.textContent = formatCurrency(balance);
|
| 281 |
+
|
| 282 |
+
// Update trades table
|
| 283 |
+
renderTrades();
|
| 284 |
+
};
|
| 285 |
+
|
| 286 |
+
// Render trades table
|
| 287 |
+
const renderTrades = () => {
|
| 288 |
+
tradesTableEl.innerHTML = '';
|
| 289 |
+
trades.slice(0, 5).forEach(trade => {
|
| 290 |
+
const row = document.createElement('tr');
|
| 291 |
+
row.className = 'border-b border-gray-700 hover:bg-gray-700';
|
| 292 |
+
row.innerHTML = `
|
| 293 |
+
<td class="py-3">${trade.date}</td>
|
| 294 |
+
<td>${trade.pair}</td>
|
| 295 |
+
<td class="${trade.type === 'Buy' ? 'text-green-400' : 'text-red-400'}">${trade.type}</td>
|
| 296 |
+
<td>${formatCurrency(trade.price)}</td>
|
| 297 |
+
<td>${trade.amount.toFixed(4)} BTC</td>
|
| 298 |
+
<td>${formatCurrency(trade.total)}</td>
|
| 299 |
+
<td class="text-green-400">${trade.status}</td>
|
| 300 |
+
`;
|
| 301 |
+
tradesTableEl.appendChild(row);
|
| 302 |
+
});
|
| 303 |
+
};
|
| 304 |
+
|
| 305 |
+
// Event listeners
|
| 306 |
+
refreshBtn.addEventListener('click', updatePrice);
|
| 307 |
+
|
| 308 |
+
buyBtn.addEventListener('click', () => {
|
| 309 |
+
const amount = parseFloat(tradeAmountEl.value);
|
| 310 |
+
if (amount && amount > 0 && amount <= balance) {
|
| 311 |
+
addTrade('Buy', amount / currentPrice);
|
| 312 |
+
tradeAmountEl.value = '';
|
| 313 |
+
} else {
|
| 314 |
+
alert('Invalid amount or insufficient balance');
|
| 315 |
+
}
|
| 316 |
+
});
|
| 317 |
+
|
| 318 |
+
sellBtn.addEventListener('click', () => {
|
| 319 |
+
const amount = parseFloat(tradeAmountEl.value);
|
| 320 |
+
if (amount && amount > 0) {
|
| 321 |
+
addTrade('Sell', amount / currentPrice);
|
| 322 |
+
tradeAmountEl.value = '';
|
| 323 |
+
} else {
|
| 324 |
+
alert('Invalid amount');
|
| 325 |
+
}
|
| 326 |
+
});
|
| 327 |
+
|
| 328 |
+
// Initialize
|
| 329 |
+
updatePrice();
|
| 330 |
+
renderTrades();
|
| 331 |
+
|
| 332 |
+
// Simulate price changes every 3 seconds
|
| 333 |
+
setInterval(updatePrice, 3000);
|
| 334 |
+
</script>
|
| 335 |
+
<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=tonymontana2064/simple-trading" style="color: #fff;text-decoration: underline;" target="_blank" >🧬 Remix</a></p></body>
|
| 336 |
+
</html>
|