mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-14 00:07:01 +08:00
feat: add exchange_id field to trader_positions table
- Add exchange_id column to track which exchange the position is from - Update all SELECT/INSERT queries to include exchange_id - Set exchange_id when creating position record in AutoTrader - Add migration to add column to existing tables
This commit is contained in:
@@ -1548,6 +1548,7 @@ func (at *AutoTrader) recordPositionChange(orderID, symbol, side, action string,
|
||||
// 开仓:创建新的仓位记录
|
||||
pos := &store.TraderPosition{
|
||||
TraderID: at.id,
|
||||
ExchangeID: at.exchange, // 记录具体的交易所ID
|
||||
Symbol: symbol,
|
||||
Side: side, // LONG or SHORT
|
||||
Quantity: quantity,
|
||||
|
||||
Reference in New Issue
Block a user