From 818619bc70e2f7e90b56ac34169572b45332140a Mon Sep 17 00:00:00 2001 From: hjhan Date: Thu, 25 Jun 2026 19:15:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85DV01=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E7=9A=84=E6=B3=A8=E9=87=8A:=E6=98=8E?= =?UTF-8?q?=E7=A1=AE=E8=BE=93=E5=87=BA=E5=8D=95=E4=BD=8D=E4=B8=BA=E4=B8=87?= =?UTF-8?q?=E5=85=83=E5=8F=8A=E5=85=A5=E5=8F=82=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dv01Helper.CalcDv01 与业界标准一致,但输出单位是万元而非元,且 PosiQuantity须为元面值单位。原注释未说明这些口径,易导致误读。 补充: - 类注释:写明公式等价业界标准DV01(元)/10000,输出万元 - posiQuantity入参:标注须为元面值单位 - vobp入参:标注为每100元面值1bp的价格变动 - 返回值:标注单位为万元 - 券面总额计算行:标注交易数量单位为元面值 仅注释改动,不改逻辑。 --- YLErpDAL/Helpers/Dv01Helper.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/YLErpDAL/Helpers/Dv01Helper.cs b/YLErpDAL/Helpers/Dv01Helper.cs index 70c0b370..408bdd2c 100644 --- a/YLErpDAL/Helpers/Dv01Helper.cs +++ b/YLErpDAL/Helpers/Dv01Helper.cs @@ -7,7 +7,10 @@ namespace YLErp.Helpers { /// /// DV01计算工具类 - /// DV01 = 方向 * (券面总额(万元) / 单位面值) * 中债基点价值 + /// 公式: DV01(万元) = 方向 * (持仓面值(万元) / 单位面值) * 中债基点价值 + /// 等价业界标准: DV01(元) = 持仓面值(元) / 100 * vobp,本方法输出为该值的 1/10000(即万元)。 + /// 注意: PosiQuantity 入参须为"元面值"单位(由 PosiNotionalValue/PosiGrossPrice 反推); + /// 单位面值默认 100,取自 UnderlyingBond.Price;vobp 为"每100元面值1bp的价格变动"。 /// public static class Dv01Helper { @@ -15,11 +18,11 @@ namespace YLErp.Helpers /// 计算DV01 /// /// 标的代码 - /// 持仓数量 + /// 持仓数量,须为"元面值"单位(如1000000=100万元面值) /// 收支方向: 1=收取, 2=支付 /// 多空方向: 1=多头, 2=空头 - /// 中债基点价值 - /// DV01值 + /// 中债基点价值(每100元面值,收益率变动1bp的价格变动) + /// DV01值,单位为"万元" public static decimal CalcDv01(string underlyingCode, decimal posiQuantity, int posiDirection, int positionType, decimal vobp) { if (vobp == 0 || posiQuantity == 0) return 0; @@ -32,7 +35,7 @@ namespace YLErp.Helpers int direction = (posiDirection == (int)SwapDirectionEnum.收取 ? 1 : -1) * (positionType == (int)PositionTypeFlag.Long ? 1 : -1); - // 券面总额(万元) = 交易数量 / 10000 + // 券面总额(万元) = 交易数量(元面值) / 10000 double faceValueWan = Convert.ToDouble(posiQuantity) / 10000d; // 单位面值, 默认100