fix bug
This commit is contained in:
@@ -35,6 +35,7 @@ type CollectorOrder struct {
|
|||||||
TradedPrice float64 `json:"traded_price" gorm:"type:decimal(10,4);not null;default:0;column:traded_price;comment:成交均价"`
|
TradedPrice float64 `json:"traded_price" gorm:"type:decimal(10,4);not null;default:0;column:traded_price;comment:成交均价"`
|
||||||
TradedVolume int `json:"traded_volume" gorm:"not null;default:0;column:traded_volume;comment:成交数量"`
|
TradedVolume int `json:"traded_volume" gorm:"not null;default:0;column:traded_volume;comment:成交数量"`
|
||||||
OrderStatus int `json:"order_status" gorm:"not null;default:0;column:order_status;comment:订单状态"`
|
OrderStatus int `json:"order_status" gorm:"not null;default:0;column:order_status;comment:订单状态"`
|
||||||
|
OffsetFlag int `json:"offset_flag" gorm:"not null;default:0;column:offset_flag;comment:开平标志"`
|
||||||
OrderTime int64 `json:"order_time" gorm:"not null;column:order_time;comment:下单时间戳"`
|
OrderTime int64 `json:"order_time" gorm:"not null;column:order_time;comment:下单时间戳"`
|
||||||
OrderRemark string `json:"order_remark" gorm:"type:text;column:order_remark;comment:订单备注"`
|
OrderRemark string `json:"order_remark" gorm:"type:text;column:order_remark;comment:订单备注"`
|
||||||
DataHash string `json:"data_hash" gorm:"type:varchar(64);not null;comment:数据哈希值(用于变化检测)"`
|
DataHash string `json:"data_hash" gorm:"type:varchar(64);not null;comment:数据哈希值(用于变化检测)"`
|
||||||
|
|||||||
@@ -139,6 +139,10 @@ func (s *Storage) SaveStatus(status *types.Status, dataHash string) error {
|
|||||||
if order.StockCode == "" {
|
if order.StockCode == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
// 只存储成交的订单
|
||||||
|
if order.OrderStatus != 56 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
var open_price float64
|
var open_price float64
|
||||||
var info types.OrderInfo
|
var info types.OrderInfo
|
||||||
err = json.Unmarshal([]byte(order.OrderRemark), &info)
|
err = json.Unmarshal([]byte(order.OrderRemark), &info)
|
||||||
@@ -165,6 +169,7 @@ func (s *Storage) SaveStatus(status *types.Status, dataHash string) error {
|
|||||||
OrderTime: order.OrderTime,
|
OrderTime: order.OrderTime,
|
||||||
OrderRemark: order.OrderRemark,
|
OrderRemark: order.OrderRemark,
|
||||||
DataHash: dataHash,
|
DataHash: dataHash,
|
||||||
|
OffsetFlag: order.OffsetFlag,
|
||||||
CollectedAt: now,
|
CollectedAt: now,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ type Order struct {
|
|||||||
TradedPrice float64 `json:"traded_price"`
|
TradedPrice float64 `json:"traded_price"`
|
||||||
TradedVolume int `json:"traded_volume"`
|
TradedVolume int `json:"traded_volume"`
|
||||||
Volume int `json:"volume"`
|
Volume int `json:"volume"`
|
||||||
|
OffsetFlag int `json:"offset_flag"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Position 持仓信息
|
// Position 持仓信息
|
||||||
|
|||||||
Reference in New Issue
Block a user