bug修复

This commit is contained in:
吴方海
2025-04-18 14:12:26 +08:00
parent 54b920b852
commit e4ef5d7d25
25 changed files with 134 additions and 145 deletions
@@ -301,7 +301,7 @@ namespace YLErp.Modules.SwapModule
var unwindEvents = flowEvents.Where(x => x.PositionId == posi.id).ToList();//当前日平仓信息
var realPosition = realPosiList.FirstOrDefault(s => s.PositionId == posi.id);
eod_swap_position eodPosi = new eod_swap_position();
if (eodPosition == null || td.TradeDate == settleDate)
if (eodPosition == null)
{
eodPosi = SaveCurrentEodInitalPosi(posi, td, settleDate, preSettleDate, unwindEvents);
}
@@ -1259,19 +1259,18 @@ namespace YLErp.Modules.SwapModule
curretEod.PosiNetFeePrice = position.PosiNetFeePrice;
curretEod.PosiNetNoFeePrice = position.PosiNetNoFeePrice;
curretEod.PosiQuantity = position.PosiQuantity;
curretEod.PosiTradingFee = -position.PosiTradingFee * directionRatio;
curretEod.PosiFeePending = -position.PosiTradingFeePending * directionRatio;
}
else
{
var eventTradingFee = openFlowEvents.Sum(s => s.TradingFee);
curretEod.PosiTradingFee = eod.PosiTradingFee - eventTradingFee * directionRatio;
var eventTradingFee = openFlowEvents.Sum(s => s.TradingFeePending);
curretEod.PosiFeePending = eod.PosiFeePending - eventTradingFee * directionRatio;
if (openFlowEvents.Count() == 0)
{
curretEod.PosiNetPrice = eod.PosiNetPrice;
curretEod.PosiGrossPrice = eod.PosiGrossPrice;
curretEod.PosiNetFeePrice = eod.PosiNetFeePrice;
curretEod.PosiNetNoFeePrice = eod.PosiNetNoFeePrice;
curretEod.PosiFeePending = curretEod.PosiFeePending<0 ? 0: curretEod.PosiFeePending;
}
else //平仓数量一定<持仓数量
{