This commit is contained in:
2025-03-12 16:56:37 +08:00
parent 0352da5616
commit 8e5b4f013c
3 changed files with 4 additions and 6 deletions

View File

@ -497,12 +497,10 @@ func handleFutMainOrderFilled(db *gorm.DB, preOrder *models.LinePreOrder, extOrd
orderExt := models.LinePreOrderExt{}
db.Model(&orderExt).Where("order_id =?", extOrderId).First(&orderExt)
totalNum := getFuturesPositionAvailableQuantity(db, apiInfo, preOrder, tradeSet).Truncate(int32(tradeSet.AmountDigit))
price := utility.StrToDecimal(preOrder.Price).Truncate(int32(tradeSet.PriceDigit))
// 更新订单数量并处理止盈、止损、减仓
for _, order := range orders {
price := utility.StrToDecimal(order.Price).Truncate(int32(tradeSet.PriceDigit))
order.Price = price.String()
// 更新止盈止损订单数量
num := updateOrderQuantity(db, order, preOrder, &orderExt, totalNum, first, tradeSet)