名义本金bug修复
This commit is contained in:
@@ -140,15 +140,7 @@ namespace YLErp.Modules.SwapModule
|
||||
var longEventTypes = eventTyps;
|
||||
longEventTypes.Add((int)SwapFlowEventTypeEnum.开仓);
|
||||
var flowEvents = new List<swap_flow_event>();
|
||||
Expression<Func<swap_flow_event, bool>> eventExpression = x => x.SwapTradeId == td.id && x.DataState == (int)SwapFlowDateStateEnum.完成 && longEventTypes.Contains(x.EventType);
|
||||
if (settleDate == td.TradeDate)
|
||||
{
|
||||
eventExpression = eventExpression.And(x => x.EventDate == settleDate);
|
||||
}
|
||||
else
|
||||
{
|
||||
eventExpression = eventExpression.And(x => x.UnwindDate == settleDate);
|
||||
}
|
||||
Expression<Func<swap_flow_event, bool>> eventExpression = x => x.SwapTradeId == td.id && x.DataState == (int)SwapFlowDateStateEnum.完成 && longEventTypes.Contains(x.EventType)&& x.EventDate == settleDate;
|
||||
flowEvents = DbContext.swap_flow_event.Where(eventExpression).ToList();
|
||||
var preDealDate = GetPreDealDate(td.id, settleDate, eventTyps);//上一次平仓/互换/自动互换处理日期
|
||||
List<swap_flow_event> autoInterests = new List<swap_flow_event>();//自动互换利息腿信息
|
||||
@@ -1360,7 +1352,6 @@ namespace YLErp.Modules.SwapModule
|
||||
}
|
||||
curretEod.TdCloseDividend = curretEod.TdPosiDividend;
|
||||
curretEod.UnderlyingMarketValue = curretEod.UnderlyingPrice * curretEod.PosiQuantity * curretEod.ContractSize * shortRatio;
|
||||
curretEod.PosiNotionalValue = curretEod.PosiQuantity * curretEod.ContractSize;
|
||||
curretEod.PosiMtmPnL = (curretEod.UnderlyingPrice - curretEod.PosiGrossPrice) * curretEod.PosiQuantity * curretEod.ContractSize * shortRatio * directionRatio;
|
||||
curretEod.PosiDividendSum = curretEod.TdPosiDividend;
|
||||
curretEod.PosiProfitSum = curretEod.PosiMtmPnL + curretEod.PosiDividendSum + curretEod.VTradingFee;
|
||||
|
||||
@@ -371,8 +371,8 @@ namespace YLErp.Modules.SwapModule
|
||||
|
||||
flow_Event.Quantity = position.PosiQuantity;
|
||||
flow_Event.PositionQty = flow_Event.Quantity;
|
||||
flow_Event.TradingAmount = position.PosiQuantity * position.ContractSize;
|
||||
flow_Event.TradingFee = position.PosiTradingFee * -1;//费用先按负数处理
|
||||
flow_Event.TradingAmount = position.PosiNotionalValue;
|
||||
flow_Event.TradingFee = position.PosiTradingFee;
|
||||
flow_Event.MarkClosePnl = 0;
|
||||
flow_Event.CloseFee = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user