diff --git a/trader/binance_futures.go b/trader/binance_futures.go index b6471787..f5c9c9b7 100644 --- a/trader/binance_futures.go +++ b/trader/binance_futures.go @@ -214,19 +214,12 @@ func (t *FuturesTrader) SetMarginMode(symbol string, isCrossMargin bool) error { } // 尝试设置仓位模式 -<<<<<<< HEAD - err := t.client.NewChangeMarginTypeService(). - Symbol(symbol). - MarginType(marginType). - Do(context.Background()) -======= err := t.callWithTimeSync("设置仓位模式", func() error { return t.client.NewChangeMarginTypeService(). Symbol(symbol). MarginType(marginType). Do(context.Background()) }) ->>>>>>> pr-313-time-sync marginModeStr := "全仓" if !isCrossMargin { diff --git a/web/src/components/TraderConfigModal.tsx b/web/src/components/TraderConfigModal.tsx index 528f763f..2875ac6b 100644 --- a/web/src/components/TraderConfigModal.tsx +++ b/web/src/components/TraderConfigModal.tsx @@ -1,6 +1,10 @@ import { useState, useEffect } from 'react'; import type { AIModel, Exchange, CreateTraderRequest } from '../types'; +// WebSocket 流數限制常量 +const MAX_SYMBOLS = 250; // Binance WebSocket 限制:1024 流 / 4 時間週期 = 250 幣種 +const WARNING_THRESHOLD = 200; // 接近上限時顯示警告 + // 提取下划线后面的名称部分 function getShortName(fullName: string): string { const parts = fullName.split('_'); @@ -387,6 +391,73 @@ export function TraderConfigModal({ )} + + {/* 幣種數量提示 */} + {selectedCoins.length > 0 && ( +