- 🔴 Data race: Add GetPositionsCopy() returning deep copies (no shared ArbPosition pointers). Use it in dashboard broadcastLoop + handleStatus. - 🟡 Scale-in PnL: Track LongEntryPrices/ShortEntryPrices on ArbPosition, compute weighted average (harmonic mean) at exit for accurate PnL. - 🟢 CalcNetProfit: Delete dead code from exchange/helpers.go. - 🟢 HL nonce: Add sync.Mutex around lastNonce++ (thread safety). - 🟢 Hourly check: Change from 5-second window to minute window. - 🟢 ExitPrice: Test mode closeLeg already handled by checkExit.
6 lines
223 B
Go
6 lines
223 B
Go
package exchange
|
|
|
|
// Package-level helpers for the exchange package.
|
|
// connector.go imports gorilla/websocket, so this file needs no imports
|
|
// for that dependency. CalcNetProfit was removed (see netProfit in scanner.go).
|