mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-11 06:46:59 +08:00
Fix 历史最高收益率(百分比), 盈亏金额 USDT, 最高收益率 没有传递给 AI 作决策,无法在 prompt 中使用 (#651)
This commit is contained in:
@@ -647,6 +647,11 @@ func (at *AutoTrader) buildTradingContext() (*decision.Context, error) {
|
||||
}
|
||||
updateTime := at.positionFirstSeenTime[posKey]
|
||||
|
||||
// 获取该持仓的历史最高收益率
|
||||
at.peakPnLCacheMutex.RLock()
|
||||
peakPnlPct := at.peakPnLCache[symbol]
|
||||
at.peakPnLCacheMutex.RUnlock()
|
||||
|
||||
positionInfos = append(positionInfos, decision.PositionInfo{
|
||||
Symbol: symbol,
|
||||
Side: side,
|
||||
@@ -656,6 +661,7 @@ func (at *AutoTrader) buildTradingContext() (*decision.Context, error) {
|
||||
Leverage: leverage,
|
||||
UnrealizedPnL: unrealizedPnl,
|
||||
UnrealizedPnLPct: pnlPct,
|
||||
PeakPnLPct: peakPnlPct,
|
||||
LiquidationPrice: liquidationPrice,
|
||||
MarginUsed: marginUsed,
|
||||
UpdateTime: updateTime,
|
||||
|
||||
Reference in New Issue
Block a user