平仓,如果平仓名义本金>持仓名义本金 =持仓名义本金
This commit is contained in:
@@ -850,6 +850,7 @@ namespace YLErp.Modules.SwapModule
|
||||
unwindData.CloseMethod = unwindQty == unwindData.PositionQty ? (int)CloseMethodEnum.全部平仓 : (int)CloseMethodEnum.部分平仓;
|
||||
unwindData.ClosePercent = unwindData.PositionQty == 0 ? 0 : unwindPercent;
|
||||
unwindData.CloseNotionalValue = position == null ? 0 : unwindQty * position.PosiGrossPrice * position.ContractSize;
|
||||
unwindData.CloseNotionalValue = unwindData.CloseNotionalValue > unwindData.PosiNotionalValue? unwindData.PosiNotionalValue: unwindData.CloseNotionalValue;
|
||||
unwindData.CloseQty = unwindQty;
|
||||
if (position != null)
|
||||
{
|
||||
@@ -881,7 +882,7 @@ namespace YLErp.Modules.SwapModule
|
||||
floatEvent.TradingFee = closeFee;
|
||||
floatEvent.MarkClosePnl = (unwindPrice - position.PosiGrossPrice) * unwindQty * floatRatio * longRatio;
|
||||
floatEvent.MarkClosePnl = Math.Round(floatEvent.MarkClosePnl + ((floatEvent.TradingFeePending+ closeFee) * floatRatio * -1), ConsGlobal.MoneyRound, MidpointRounding.AwayFromZero);
|
||||
floatEvent.TradingAmount = unwindPrice * floatEvent.Quantity * floatEvent.ContractSize;
|
||||
floatEvent.TradingAmount = unwindData.CloseNotionalValue;
|
||||
floatEvent.OptLog = "流水自动";
|
||||
floatEvent.ClientId = td.ClientId;
|
||||
floatEvent.SetOpt(UserInfo);
|
||||
|
||||
Reference in New Issue
Block a user