          
            closedPositions.forEach(position => {
                try {
                    const profit = parseFloat(position.realizedProfit);
                    if (!isNaN(profit)) {
                        totalProfit += profit;
                        
                        // 計算盈利交易次數
                        if (profit > 0) {
                            winCount++;
                        }
                    }
                } catch (e) {
                    console.err