对冲交易 持仓名义本金
This commit is contained in:
@@ -264,7 +264,7 @@ namespace YLErp.Modules.CalculationModule
|
||||
newPnl.RealizedPnL += closeProfit;
|
||||
|
||||
//减去持仓成本
|
||||
newPnl.Cost -= openAmount;
|
||||
newPnl.Cost += closeAmount;
|
||||
|
||||
//减去持仓份额
|
||||
newPnl.Notional -= closeNotional * posSign;
|
||||
@@ -483,6 +483,11 @@ namespace YLErp.Modules.CalculationModule
|
||||
/// </summary>
|
||||
public static string GetHedgeUniqueCode(int BookId, string TradeType, string LongShort, string UnderlyingCode, string ExchangeOptionCode = null)
|
||||
{
|
||||
List<string> tradeTypes=new List<string>() { "利率债", "信用债", "其它债券" };
|
||||
if (tradeTypes.Contains(TradeType))
|
||||
{
|
||||
return $"{BookId}_{TradeType}_{UnderlyingCode}".ToUpperInvariant();
|
||||
}
|
||||
return $"{BookId}_{TradeType}_{LongShort}_{("场内期权".Equals(TradeType) ? ExchangeOptionCode : UnderlyingCode)}".ToUpperInvariant();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user