|
|
@@ -228,9 +228,9 @@ func GetTradePosition(accIds string, tradeModes string) (rst []QueryTradePositio
|
|
|
// #96004 改为固定3位小数
|
|
|
// #3524 又改为跟商品价格小数位走 2022.04.07
|
|
|
// 运维提出, 不要四舍五入, 改为去尾法 2022.04.26
|
|
|
- tradePosition.AveragePrice, _ = decimal.NewFromFloat(averagePrice).Truncate(int32(v.Decimalplace)).Float64()
|
|
|
+ tradePosition.AveragePrice, _ = decimal.NewFromFloat(averagePrice).Truncate(int32(v.Decimalplace + 1)).Float64()
|
|
|
tradePosition.PositionPL, tradePosition.MarketAmount, tradePosition.LastPrice = fCalcPL(tradePosition.GoodsCode, tradePosition.BuyOrSell, tradePosition.CurPositionQTY,
|
|
|
- tradePosition.AveragePrice, tradePosition.AgreeUnit, tradePosition.DecimalPlace)
|
|
|
+ tradePosition.AveragePrice, tradePosition.AgreeUnit, tradePosition.DecimalPlace+1)
|
|
|
if tradePosition.CurHolderAmount > 1e-10 {
|
|
|
tradePosition.PositionPLRate = tradePosition.PositionPL / tradePosition.CurHolderAmount
|
|
|
tradePosition.PositionPLRate, _ = strconv.ParseFloat(utils.FormatFloat(tradePosition.PositionPLRate, 4), 64)
|