Trading Strategies
Total:
ID Name Description Timeframe Status Created By Schedule Telegram Created At Actions
Loading strategies...
📈 Current Positions
Active: 0
INSTRUMENT POSITION TYPE ENTRY PRICE ENTRY TIME CURRENT VALUE
No active positions
// Function to update trades table function updateTradesTable(trades) { const tbody = document.querySelector('.table-striped tbody'); if (!tbody) { console.error("❌ Could not find trades table body"); return; } // Clear existing rows tbody.innerHTML = ''; // Calculate trade statistics let winCount = 0; let lossCount = 0; let totalPL = 0; // Add new rows trades.forEach((trade, index) => { const row = document.createElement('tr'); // Format trade data const tradeStartDate = new Date(trade.open_time * 1000).toISOString().replace('T', ' ').slice(0, 19) + 'Z'; const tradeEndDate = trade.close_time ? new Date(trade.close_time * 1000).toISOString().replace('T', ' ').slice(0, 19) + 'Z' : ''; const profitLoss = trade.profit_loss ? trade.profit_loss.toFixed(2) : '0.00'; const duration = trade.duration ? Math.floor(trade.duration / (24 * 60 * 60)) : 0; // Convert seconds to days // Update statistics if (trade.close_time) { if (parseFloat(profitLoss) > 0) { winCount++; } else if (parseFloat(profitLoss) < 0) { lossCount++; } totalPL += parseFloat(profitLoss); } row.innerHTML = ` ${index + 1} ${trade.type === 'buy' ? 'Buy' : 'Sell'} ETHUSD ${trade.type === 'buy' ? 'Buy' : 'Sell'} ${trade.close_time ? '1' : '0'} ${tradeStartDate} ${trade.open_price.toFixed(2)} ${tradeEndDate} ${trade.close_price ? trade.close_price.toFixed(2) : '0.00'} ${profitLoss} ${duration} ${trade.close_price ? trade.close_price.toFixed(2) : trade.open_price.toFixed(2)} ${(trade.type === 'buy' ? trade.open_price * 1.02 : trade.open_price * 0.98).toFixed(2)} ${(trade.type === 'buy' ? trade.open_price * 0.98 : trade.open_price * 1.02).toFixed(2)} `; tbody.appendChild(row); }); // Update statistics display document.getElementById('win-count').textContent = winCount; document.getElementById('loss-count').textContent = lossCount; document.getElementById('total-pl').textContent = totalPL.toFixed(2); }