fix(trader): get peakPnlPct using posKey (#955)

Co-authored-by: zbhan <zbhan@freewheel.tv>
This commit is contained in:
Shui
2025-11-12 21:33:14 -05:00
committed by tangmengqiu
parent 217ccb08dd
commit 0ede0809ad
2 changed files with 8 additions and 8 deletions

View File

@@ -651,7 +651,7 @@ func (at *AutoTrader) buildTradingContext() (*decision.Context, error) {
// 获取该持仓的历史最高收益率
at.peakPnLCacheMutex.RLock()
peakPnlPct := at.peakPnLCache[symbol]
peakPnlPct := at.peakPnLCache[posKey]
at.peakPnLCacheMutex.RUnlock()
positionInfos = append(positionInfos, decision.PositionInfo{