feature: 增强收益tag 将利率填入固定收益率
This commit is contained in:
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -241,11 +241,21 @@ namespace YLErp.Plugins.GuoLian.DocumentGenerator
|
||||
dic["参考标的期初全价%"] = ((double)swapPosition.PosiGrossPrice * 100).ToString("N4");
|
||||
dic["参考标的期初净价%"] = ((double)(swapPosition.PosiNetNoFeePrice ?? 0m) * 100).ToString("N4");
|
||||
|
||||
// 固定收益率(年化)- 债券期初到期收益率
|
||||
//dic["固定收益率(年化)"] = swapPosition.InitYtm.HasValue
|
||||
// ? ((double)swapPosition.InitYtm.Value * 100).ToString("N4")
|
||||
// : "0.0000";
|
||||
dic["固定收益率(年化)"] = "0.0000"; //需求说直接都是0
|
||||
// 固定收益率(年化)- ETF默认取"增强收益"腿的计息利率
|
||||
bool isEtf = IsBondEtf(underlying?.UnderlyingCode ?? string.Empty);
|
||||
if (isEtf)
|
||||
{
|
||||
var enhancePosition = swapPositions
|
||||
.Where(x => ConsTrade.InterestModels.Contains(x.InterestMode) && x.category_tag == "增强收益")
|
||||
.FirstOrDefault();
|
||||
dic["固定收益率"] = enhancePosition != null
|
||||
? ((double)enhancePosition.InterestRateDefault * 100).ToString("N4")
|
||||
: "0.0000";
|
||||
}
|
||||
else
|
||||
{
|
||||
dic["固定收益率"] = "0.0000";
|
||||
}
|
||||
|
||||
// 获取客户适用的保证金率
|
||||
var clientMarginRate = UnderlyingHelper.GetApplicableMarginRate(
|
||||
@@ -405,9 +415,18 @@ namespace YLErp.Plugins.GuoLian.DocumentGenerator
|
||||
: "0.0000";
|
||||
|
||||
// 利率类型判断(固定/浮动)
|
||||
var interestMargin = swapPositions
|
||||
.Where(x => ConsTrade.InterestModels.Contains(x.InterestMode) && x.interest_rest_days != null)
|
||||
.FirstOrDefault();
|
||||
swap_position interestMargin = null;
|
||||
// ETF: 优先取"互换利率"腿
|
||||
if (isEtf)
|
||||
{
|
||||
interestMargin = swapPositions
|
||||
.Where(x => ConsTrade.InterestModels.Contains(x.InterestMode) && x.category_tag == "互换利率")
|
||||
.FirstOrDefault();
|
||||
}
|
||||
if (interestMargin == null)
|
||||
interestMargin = swapPositions
|
||||
.Where(x => ConsTrade.InterestModels.Contains(x.InterestMode) && x.interest_rest_days != null)
|
||||
.FirstOrDefault();
|
||||
if (interestMargin == null)
|
||||
interestMargin = swapPositions
|
||||
.Where(x => ConsTrade.InterestModels.Contains(x.InterestMode) && string.IsNullOrWhiteSpace(x.FloatRateUnderlyingCode))
|
||||
|
||||
Reference in New Issue
Block a user