From aa14bbd5162620be498d3de2d5ac9bc984e1ebc0 Mon Sep 17 00:00:00 2001 From: gongpei Date: Tue, 26 May 2026 10:00:59 +0800 Subject: [PATCH 01/10] =?UTF-8?q?fix:=20=E4=BB=98=E6=81=AF=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=97=A5=E6=9C=9F=E7=B1=BB=E5=9E=8B=E6=94=AF=E6=8C=81?= =?UTF-8?q?DBNull?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Framework/YLErp.Core/DBModels/BondPayment.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Framework/YLErp.Core/DBModels/BondPayment.cs b/Framework/YLErp.Core/DBModels/BondPayment.cs index 94056c19..aae29465 100644 --- a/Framework/YLErp.Core/DBModels/BondPayment.cs +++ b/Framework/YLErp.Core/DBModels/BondPayment.cs @@ -98,12 +98,12 @@ namespace YLErp.DBModels /// 发布时间 /// [Column("insert_time")] - public DateTime create_time { get; set; } + public DateTime? create_time { get; set; } /// /// 更新时间 /// [DisplayName("更新时间")] [Column("update_time")] - public DateTime update_time { get; set; } + public DateTime? update_time { get; set; } } } From 3d06e599088ba069d7e1d2df6603220ed3a50f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=B9=E6=B5=B7?= Date: Wed, 27 May 2026 18:24:05 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E7=9B=98=E4=B8=AD=E5=B9=B3=E4=BB=93?= =?UTF-8?q?=E5=88=A9=E6=81=AF=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SwapModule/GetInterestsUnitTest.cs | 2 +- .../Modules/SwapModule/SwapDealService.cs | 26 +++++++++++-------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/UnitTestProject/Modules/SwapModule/GetInterestsUnitTest.cs b/UnitTestProject/Modules/SwapModule/GetInterestsUnitTest.cs index 30c02dde..2c748aca 100644 --- a/UnitTestProject/Modules/SwapModule/GetInterestsUnitTest.cs +++ b/UnitTestProject/Modules/SwapModule/GetInterestsUnitTest.cs @@ -609,7 +609,7 @@ namespace YLErp.Modules.SwapModule ExpectedInterest(1, FixedRate, 0.001m, Principal * 0.5m)) }; var eodInterest = CalcEod("10", new DateTime(2026, 4, 30), eodPositions); - var expectedEod = ExpectedInterest(1, FixedRate, 0.001m, Principal * 0.5m); + var expectedEod = ExpectedInterest(2, FixedRate, 0.001m, Principal * 0.5m); Assert.AreEqual(expectedEod, eodInterest.InterestAmount); } diff --git a/YLErpDAL/Modules/SwapModule/SwapDealService.cs b/YLErpDAL/Modules/SwapModule/SwapDealService.cs index b8bbd82a..38d2f857 100644 --- a/YLErpDAL/Modules/SwapModule/SwapDealService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapDealService.cs @@ -406,7 +406,7 @@ namespace YLErp.Modules.SwapModule else { // 盘中互换场景,使用 CalcUnwindInterest - interests.Add(CalcUnwindInterest(td, valueDate, endDate, positionClone, rate, floatRate, posiPrincipal, closePrincipal, newClosePercent, annualDays, preEodPosition, eventType, add, swap, orginPv)); + interests.Add(CalcUnwindInterest(td, valueDate, endDate, positionClone, rate, floatRate, posiPrincipal, closePrincipal, newClosePercent, annualDays, preEodPosition, eventType, add, swap, orginPv, calcFirst, calcLast)); } } return interests; @@ -557,7 +557,7 @@ namespace YLErp.Modules.SwapModule /// /// 计算盘中利息(平仓/互换) /// - private swap_flow_event CalcUnwindInterest(trade td, DateTime valueDate, DateTime endDate, swap_position position, decimal rate, decimal floatRate, decimal posiPrincipal, decimal closePrincipal, decimal closePercent, int annualDays, eod_swap_position preEod, int eventType, bool add, bool swap, decimal orginPv) + private swap_flow_event CalcUnwindInterest(trade td, DateTime valueDate, DateTime endDate, swap_position position, decimal rate, decimal floatRate, decimal posiPrincipal, decimal closePrincipal, decimal closePercent, int annualDays, eod_swap_position preEod, int eventType, bool add, bool swap, decimal orginPv, bool calcFirst, bool calcLast) { if (preEod.id == 0) { @@ -567,7 +567,7 @@ namespace YLErp.Modules.SwapModule preEod.ValueDate = td.TradeDate.Value; } - return InitSwapDealInterest(td, valueDate, endDate, rate, position, add, swap, posiPrincipal, closePrincipal, closePercent, annualDays, eventType, preEod, false, orginPv); + return InitSwapDealInterest(td, valueDate, endDate, rate, position, add, swap, posiPrincipal, closePrincipal, closePercent, annualDays, eventType, preEod, false, orginPv, calcFirst, calcLast); } /// /// 初始化利息腿信息 @@ -598,7 +598,9 @@ namespace YLErp.Modules.SwapModule int eventType, eod_swap_position preEodPosition, bool needPrice, - decimal orginPv + decimal orginPv, + bool calcFirst, + bool calcLast ) { decimal interestProfitSum = preEodPosition.InterestProfitSum; @@ -633,11 +635,11 @@ namespace YLErp.Modules.SwapModule var floateRate = preEodPosition.FloatRate; if (position.InterestType == (int)InterestTypeEnum.复利) { - CalcDailyCompoundInterest(preEodPosition, endDate, position, closePosiNotionalValue, posiNotionalValue, interest, annualDays, needPrice, floateRate, closePrecent, orginPv, ref InterestAmount, ref TdInterestAmount); + CalcDailyCompoundInterest(preEodPosition, endDate, position, closePosiNotionalValue, posiNotionalValue, interest, annualDays, needPrice, floateRate, closePrecent, orginPv, calcFirst, calcLast, ref InterestAmount, ref TdInterestAmount); } else { - CalcDailySimpleInterest(preEodPosition, endDate, position, closePosiNotionalValue, posiNotionalValue, interest, annualDays, needPrice, floateRate, closePrecent, orginPv, ref InterestAmount, ref TdInterestAmount); + CalcDailySimpleInterest(preEodPosition, endDate, position, closePosiNotionalValue, posiNotionalValue, interest, annualDays, needPrice, floateRate, closePrecent, orginPv, calcFirst, calcLast, ref InterestAmount, ref TdInterestAmount); } interest.InterestAmount = Math.Round(InterestAmount, ConsGlobal.PriceRound, MidpointRounding.AwayFromZero); @@ -661,26 +663,26 @@ namespace YLErp.Modules.SwapModule /// 是否年化 /// 年化天数 /// - public void CalcDailyCompoundInterest(eod_swap_position preEodPosition, DateTime endDate, swap_position position, decimal principal, decimal posiPrincipal, swap_flow_event flowEvent, int annualDays, bool needPrice, decimal floateRate, decimal closePercent, decimal orginPv, ref decimal InterestAmount, ref decimal TdInterestAmount) + public void CalcDailyCompoundInterest(eod_swap_position preEodPosition, DateTime endDate, swap_position position, decimal principal, decimal posiPrincipal, swap_flow_event flowEvent, int annualDays, bool needPrice, decimal floateRate, decimal closePercent, decimal orginPv, bool calcFirst, bool calcLast, ref decimal InterestAmount, ref decimal TdInterestAmount) { // 复利:利息并入本金 - CalcDailyInterest(preEodPosition, endDate, position, principal, posiPrincipal, flowEvent, annualDays, needPrice, floateRate, closePercent, orginPv, compoundInterest: true, ref InterestAmount, ref TdInterestAmount); + CalcDailyInterest(preEodPosition, endDate, position, principal, posiPrincipal, flowEvent, annualDays, needPrice, floateRate, closePercent, orginPv, compoundInterest: true, calcFirst, calcLast, ref InterestAmount, ref TdInterestAmount); } /// /// 计算单利 盘中(按重置天数分段,每段使用对应浮动利率) /// - public void CalcDailySimpleInterest(eod_swap_position preEodPosition, DateTime endDate, swap_position position, decimal principal, decimal posiPrincipal, swap_flow_event flowEvent, int annualDays, bool needPrice, decimal floateRate, decimal closePercent, decimal orginPv, ref decimal InterestAmount, ref decimal TdInterestAmount) + public void CalcDailySimpleInterest(eod_swap_position preEodPosition, DateTime endDate, swap_position position, decimal principal, decimal posiPrincipal, swap_flow_event flowEvent, int annualDays, bool needPrice, decimal floateRate, decimal closePercent, decimal orginPv, bool calcFirst, bool calcLast, ref decimal InterestAmount, ref decimal TdInterestAmount) { // 单利:利息不并入本金 - CalcDailyInterest(preEodPosition, endDate, position, principal, posiPrincipal, flowEvent, annualDays, needPrice, floateRate, closePercent, orginPv, compoundInterest: false, ref InterestAmount, ref TdInterestAmount); + CalcDailyInterest(preEodPosition, endDate, position, principal, posiPrincipal, flowEvent, annualDays, needPrice, floateRate, closePercent, orginPv, compoundInterest: false,calcFirst,calcLast, ref InterestAmount, ref TdInterestAmount); } /// /// 通用日度利息计算方法(单利/复利共用) /// /// 是否复利:true=利息并入本金,false=单利 - private void CalcDailyInterest(eod_swap_position preEodPosition, DateTime endDate, swap_position position, decimal principal, decimal posiPrincipal, swap_flow_event flowEvent, int annualDays, bool needPrice, decimal floateRate, decimal closePercent, decimal orginPv, bool compoundInterest, ref decimal InterestAmount, ref decimal TdInterestAmount) + private void CalcDailyInterest(eod_swap_position preEodPosition, DateTime endDate, swap_position position, decimal principal, decimal posiPrincipal, swap_flow_event flowEvent, int annualDays, bool needPrice, decimal floateRate, decimal closePercent, decimal orginPv, bool compoundInterest, bool calcFirst, bool calcLast, ref decimal InterestAmount, ref decimal TdInterestAmount) { var startDate = position.PosiStartDate; decimal interestProfitSum = preEodPosition.InterestProfitSum; @@ -695,6 +697,8 @@ namespace YLErp.Modules.SwapModule for (int i = 0; i <= calcDays; i++) { var accrueDate = startDate.AddDays(i); + if (!calcFirst && accrueDate == startDate) continue; // 首日不算头 + if (!calcLast && accrueDate == endDate) continue; // 到期日不算尾 if (accrueDate > preEodPosition.ValueDate) { if (i % interestPeriod == 0) From f873239af47e0c5fecc2bef26a1d7d61090974fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=B9=E6=B5=B7?= Date: Thu, 28 May 2026 13:23:36 +0800 Subject: [PATCH 03/10] =?UTF-8?q?#EQD-6090=20=E5=9B=BD=E8=81=94=E6=B0=91?= =?UTF-8?q?=E7=94=9F=EF=BC=9A=E5=90=8D=E4=B9=89=E6=9C=AC=E9=87=91=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E6=9C=89=E7=B2=BE=E5=BA=A6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeEdit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeEdit.js b/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeEdit.js index 6a68a4b1..e71b9f5a 100644 --- a/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeEdit.js +++ b/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeEdit.js @@ -268,9 +268,9 @@ const vue = new Vue({ this.getSpotPrice(payItem.UnderlyingCode, this.trade.StartDate, payItem); } var national = payItem.PosiQuantity * payItem.ContractSize; - var stockEqvNotional = payItem.PosiGrossPrice * national;//名义本金=期初价格*数量*乘数 + var stockEqvNotional = _.round(payItem.PosiGrossPrice * national, 2);//名义本金=期初价格*数量*乘数 this.trade.StockEqvNotional = otcformat.trading.stockEqvNotional(stockEqvNotional); - payItem.PosiNotionalValue = this.StockEqvNotional; + payItem.PosiNotionalValue = this.trade.StockEqvNotional; } }, //变更到期日 From 50d0fdacbc2d01897f94748ac955112822d63340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=B9=E6=B5=B7?= Date: Thu, 28 May 2026 14:07:20 +0800 Subject: [PATCH 04/10] =?UTF-8?q?#EQD-6089=20=E5=9B=BD=E8=81=94=E6=B0=91?= =?UTF-8?q?=E7=94=9F-=E5=88=A9=E6=81=AF=E5=A4=9A=E7=AE=97=E4=B8=80?= =?UTF-8?q?=E5=A4=A9=EF=BC=9A=E6=9C=AA=E6=94=B6=E7=9B=98=EF=BC=8C=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E5=B9=B3=E4=BB=93=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YLErpDAL/Modules/SwapModule/SwapDealService.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/YLErpDAL/Modules/SwapModule/SwapDealService.cs b/YLErpDAL/Modules/SwapModule/SwapDealService.cs index 38d2f857..9b6b3e53 100644 --- a/YLErpDAL/Modules/SwapModule/SwapDealService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapDealService.cs @@ -564,7 +564,11 @@ namespace YLErp.Modules.SwapModule preEod.FloatRate = floatRate; preEod.TdInterestPrincipal = posiPrincipal; preEod.PosiNotionalValue = posiPrincipal; - preEod.ValueDate = td.TradeDate.Value; + preEod.ValueDate = td.StartDate.Value; + if (calcFirst) + { + preEod.ValueDate= preEod.ValueDate.AddDays(-1); + } } return InitSwapDealInterest(td, valueDate, endDate, rate, position, add, swap, posiPrincipal, closePrincipal, closePercent, annualDays, eventType, preEod, false, orginPv, calcFirst, calcLast); From 3e650b8f38b858754074dc2f4a5bb356a3923fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=B9=E6=B5=B7?= Date: Thu, 28 May 2026 15:16:32 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E6=9C=9F=E5=88=9D=E6=A0=87=E7=9A=84?= =?UTF-8?q?=E4=BB=B7=E6=A0=BC=EF=BC=88=E5=80=BA=E5=88=B8=E7=9A=84=EF=BC=89?= =?UTF-8?q?=E5=B8=8C=E6=9C=9B=E6=98=AF=E5=B0=8F=E6=95=B0=E7=82=B99?= =?UTF-8?q?=E4=BD=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Framework/YLErp.Core/ConsGlobal.cs | 2 +- .../SwapModule/SwapEodPositionService.cs | 4 +- .../Modules/SwapModule/SwapTradeService.cs | 2 +- YLErpWeb/App_Data/Config/otcformat.js | 126 +++++++++++++++++- YLErpWeb/App_Data/Config/otcformat.min.js | 1 - YLErpWeb/Views/SwapTrade2/SwapIncome.cshtml | 2 +- YLErpWeb/Views/SwapTrade2/SwapUnwind.cshtml | 2 +- .../Scripts/app/swaptrade/incomeSwapTrade.js | 4 +- .../Scripts/app/swaptrade/unwindSwapTrade.js | 4 +- .../wwwroot/Style/Css/swapTradeEditV2.css | 2 +- 10 files changed, 136 insertions(+), 13 deletions(-) delete mode 100644 YLErpWeb/App_Data/Config/otcformat.min.js diff --git a/Framework/YLErp.Core/ConsGlobal.cs b/Framework/YLErp.Core/ConsGlobal.cs index 5e569910..bdf59a00 100644 --- a/Framework/YLErp.Core/ConsGlobal.cs +++ b/Framework/YLErp.Core/ConsGlobal.cs @@ -62,7 +62,7 @@ namespace YLErp /// 价格四舍五入保留位数 /// - public const int PriceRound = 10; + public const int PriceRound = 11; /// /// 金额四舍五入保留位数 /// diff --git a/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs b/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs index 848e42d2..ef390988 100644 --- a/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs @@ -1451,9 +1451,9 @@ namespace YLErp.Modules.SwapModule curretEod.PosiNetPrice = (eod.PosiNetPrice * eod.PosiQuantity + openFlowEvents.Sum(a => a.Quantity * a.TradingAmountFeeAvg)) / (eod.PosiQuantity + openQty); curretEod.PosiNetPrice = Math.Round(curretEod.PosiNetPrice, ConsGlobal.PriceRound, MidpointRounding.AwayFromZero); curretEod.PosiNetNoFeePrice = (eod.PosiNetNoFeePrice * eod.PosiQuantity + openFlowEvents.Sum(a => a.Quantity * a.TradingAmountNetAvg)) / (eod.PosiQuantity + openQty); - curretEod.PosiNetNoFeePrice = Math.Round(curretEod.PosiNetNoFeePrice ?? 0, 10, MidpointRounding.AwayFromZero); + curretEod.PosiNetNoFeePrice = Math.Round(curretEod.PosiNetNoFeePrice ?? 0, ConsGlobal.PriceRound, MidpointRounding.AwayFromZero); curretEod.PosiNetFeePrice = (eod.PosiNetFeePrice * eod.PosiQuantity + openFlowEvents.Sum(a => a.Quantity * a.TradingAmountNetFeeAvg)) / (eod.PosiQuantity + openQty); - curretEod.PosiNetFeePrice = Math.Round(curretEod.PosiNetFeePrice ?? 0, 10, MidpointRounding.AwayFromZero); + curretEod.PosiNetFeePrice = Math.Round(curretEod.PosiNetFeePrice ?? 0, ConsGlobal.PriceRound, MidpointRounding.AwayFromZero); } curretEod.PosiNotionalValue = curretEod.PosiGrossPrice * curretEod.PosiQuantity * curretEod.ContractSize; curretEod.PosiNotionalValue = Math.Round(curretEod.PosiNotionalValue, ConsGlobal.MoneyRound, MidpointRounding.AwayFromZero); diff --git a/YLErpDAL/Modules/SwapModule/SwapTradeService.cs b/YLErpDAL/Modules/SwapModule/SwapTradeService.cs index a62a6c4f..f95b4718 100644 --- a/YLErpDAL/Modules/SwapModule/SwapTradeService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapTradeService.cs @@ -1355,7 +1355,7 @@ namespace YLErp.Modules.SwapModule position.PosiNetNoFeePrice = swap.PosiNetNoFeePrice; position.PosiNetFeePrice = swap.PosiQuantity == 0 ? 0 : (swap.PosiNetNoFeePrice + (position.PosiTradingFeePending / swap.PosiQuantity) * ratio); position.PosiNetFeePrice = Math.Round(position.PosiNetFeePrice??0, ConsGlobal.PriceRound, MidpointRounding.AwayFromZero); - position.PosiNotionalValue = position.PosiGrossPrice * swap.PosiQuantity * swap.ContractSize; + position.PosiNotionalValue = swap.PosiNotionalValue; position.PosiQuantity = swap.PosiQuantity; position.InterestDirection = swap.InterestDirection; position.InterestMode = swap.InterestMode; diff --git a/YLErpWeb/App_Data/Config/otcformat.js b/YLErpWeb/App_Data/Config/otcformat.js index 78a27131..c9f9202a 100644 --- a/YLErpWeb/App_Data/Config/otcformat.js +++ b/YLErpWeb/App_Data/Config/otcformat.js @@ -1,2 +1,126 @@ var main = main || {}; -main.formatOptions={"trading":{"umprice":{"trimTailZeros":true,"precision":9,"grouping":true,"rounded":true,"percent":false,"minDecimals":2,"maxDecimals":9},"umpriceP":{"trimTailZeros":true,"percent":true,"precision":9,"grouping":false,"rounded":true,"minDecimals":2,"maxDecimals":9},"umpricePR":{"trimTailZeros":true,"precision":9,"grouping":false,"rounded":true,"percent":false,"minDecimals":2,"maxDecimals":9},"tradeSinglePrice":{"trimTailZeros":true,"precision":9,"grouping":true,"rounded":true,"percent":false,"minDecimals":2,"maxDecimals":9},"premiumRateP":{"trimTailZeros":true,"percent":true,"precision":9,"grouping":false,"rounded":true,"minDecimals":2,"maxDecimals":9},"premiumRate":{"trimTailZeros":true,"precision":9,"grouping":false,"rounded":true,"percent":false,"minDecimals":2,"maxDecimals":9},"tradePrice":{"trimTailZeros":true,"precision":9,"grouping":false,"rounded":true,"percent":false,"minDecimals":2,"maxDecimals":9},"StockEqvNotional":{"trimTailZeros":true,"precision":9,"grouping":true,"rounded":true,"percent":false,"minDecimals":2,"maxDecimals":9},"notional":{"trimTailZeros":true,"precision":9,"grouping":true,"rounded":true,"percent":false,"minDecimals":2,"maxDecimals":9},"notionalP":{"trimTailZeros":true,"percent":true,"precision":9,"grouping":false,"rounded":true,"minDecimals":2,"maxDecimals":9},"volatility":{"trimTailZeros":true,"precision":9,"grouping":false,"rounded":true,"percent":false,"minDecimals":2,"maxDecimals":9},"volatilityP":{"trimTailZeros":true,"percent":true,"precision":9,"grouping":false,"rounded":true,"minDecimals":2,"maxDecimals":9},"greek":{"trimTailZeros":true,"precision":9,"grouping":false,"rounded":true,"percent":false,"minDecimals":2,"maxDecimals":9},"marginRateP":{"trimTailZeros":true,"percent":true,"precision":9,"grouping":false,"rounded":true,"minDecimals":2,"maxDecimals":9},"marginRate":{"trimTailZeros":true,"precision":9,"grouping":false,"rounded":true,"percent":false,"minDecimals":2,"maxDecimals":9}}}; \ No newline at end of file +main.formatOptions= { + "trading": { + "umprice": { + "precision": 9, + "grouping": true, + "rounded": true, + "percent": false, + "minDecimals": 9, + "maxDecimals": 0 + }, + "umpriceP": { + "percent": true, + "precision": 2, + "grouping": false, + "rounded": true, + "minDecimals": 2, + "maxDecimals": 0 + }, + "umpricePR": { + "precision": 4, + "grouping": false, + "rounded": true, + "percent": false, + "minDecimals": 4, + "maxDecimals": 2 + }, + "tradeSinglePrice": { + "precision": 2, + "grouping": true, + "rounded": true, + "percent": false, + "minDecimals": 2, + "maxDecimals": 0 + }, + "premiumRateP": { + "percent": true, + "precision": 2, + "grouping": false, + "rounded": true, + "minDecimals": 2, + "maxDecimals": 0 + }, + "premiumRate": { + "precision": 4, + "grouping": false, + "rounded": true, + "percent": false, + "minDecimals": 4, + "maxDecimals": 2 + }, + "tradePrice": { + "precision": 2, + "grouping": false, + "rounded": true, + "percent": false, + "minDecimals": 2, + "maxDecimals": 0 + }, + "StockEqvNotional": { + "precision": 2, + "grouping": true, + "rounded": true, + "percent": false, + "minDecimals": 2, + "maxDecimals": 0 + }, + "notional": { + "precision": 2, + "grouping": true, + "rounded": true, + "percent": false, + "minDecimals": 2, + "maxDecimals": 0 + }, + "notionalP": { + "percent": true, + "precision": 2, + "grouping": false, + "rounded": true, + "minDecimals": 2, + "maxDecimals": 0 + }, + "volatility": { + "precision": 4, + "grouping": false, + "rounded": true, + "percent": false, + "minDecimals": 4, + "maxDecimals": 2 + }, + "volatilityP": { + "percent": true, + "precision": 2, + "grouping": false, + "rounded": true, + "minDecimals": 2, + "maxDecimals": 0 + }, + "greek": { + "precision": 2, + "grouping": false, + "rounded": true, + "percent": false, + "minDecimals": 2, + "maxDecimals": 0 + }, + "marginRateP": { + "percent": true, + "precision": 2, + "grouping": false, + "rounded": true, + "minDecimals": 2, + "maxDecimals": 0 + }, + "marginRate": { + "precision": 4, + "grouping": false, + "rounded": true, + "percent": false, + "minDecimals": 4, + "maxDecimals": 2 + } + } +}; + diff --git a/YLErpWeb/App_Data/Config/otcformat.min.js b/YLErpWeb/App_Data/Config/otcformat.min.js deleted file mode 100644 index 54832a1e..00000000 --- a/YLErpWeb/App_Data/Config/otcformat.min.js +++ /dev/null @@ -1 +0,0 @@ -var main=main||{};main.formatOptions={trading:{umprice:{precision:9,grouping:!0,rounded:!0,percent:!1,minDecimals:9,maxDecimals:0},umpriceP:{percent:!0,precision:6,grouping:!1,rounded:!0,minDecimals:6,maxDecimals:0},umpricePR:{precision:8,grouping:!1,rounded:!0,percent:!1,minDecimals:8,maxDecimals:2},tradeSinglePrice:{precision:6,grouping:!0,rounded:!0,percent:!1,minDecimals:6,maxDecimals:0},premiumRateP:{percent:!0,precision:4,grouping:!1,rounded:!0,minDecimals:4,maxDecimals:0},premiumRate:{precision:6,grouping:!1,rounded:!0,percent:!1,minDecimals:6,maxDecimals:2},tradePrice:{precision:2,grouping:!1,rounded:!0,percent:!1,minDecimals:2,maxDecimals:0},StockEqvNotional:{precision:2,grouping:!0,rounded:!0,percent:!1,minDecimals:2,maxDecimals:0},notional:{precision:4,grouping:!0,rounded:!0,percent:!1,minDecimals:4,maxDecimals:0},notionalP:{percent:!0,precision:4,grouping:!1,rounded:!0,minDecimals:4,maxDecimals:0},volatility:{precision:4,grouping:!1,rounded:!0,percent:!1,minDecimals:4,maxDecimals:2},volatilityP:{percent:!0,precision:2,grouping:!1,rounded:!0,minDecimals:2,maxDecimals:0},greek:{precision:3,grouping:!1,rounded:!0,percent:!1,minDecimals:3,maxDecimals:0},marginRateP:{percent:!0,precision:4,grouping:!1,rounded:!0,minDecimals:4,maxDecimals:0},marginRate:{precision:6,grouping:!1,rounded:!0,percent:!1,minDecimals:6,maxDecimals:2}}}; \ No newline at end of file diff --git a/YLErpWeb/Views/SwapTrade2/SwapIncome.cshtml b/YLErpWeb/Views/SwapTrade2/SwapIncome.cshtml index d17f8053..14e12e6b 100644 --- a/YLErpWeb/Views/SwapTrade2/SwapIncome.cshtml +++ b/YLErpWeb/Views/SwapTrade2/SwapIncome.cshtml @@ -146,7 +146,7 @@ {{priceFormat(floatPosition.PosiGrossPrice)}} {{priceFormat(floatPosition.TradingAmountNetAvg)}} - + diff --git a/YLErpWeb/Views/SwapTrade2/SwapUnwind.cshtml b/YLErpWeb/Views/SwapTrade2/SwapUnwind.cshtml index a34d3a21..612995b4 100644 --- a/YLErpWeb/Views/SwapTrade2/SwapUnwind.cshtml +++ b/YLErpWeb/Views/SwapTrade2/SwapUnwind.cshtml @@ -197,7 +197,7 @@ {{priceFormat(floatPosition.PosiGrossPrice)}} - + diff --git a/YLErpWeb/wwwroot/Scripts/app/swaptrade/incomeSwapTrade.js b/YLErpWeb/wwwroot/Scripts/app/swaptrade/incomeSwapTrade.js index fe0cab66..9846f8f8 100644 --- a/YLErpWeb/wwwroot/Scripts/app/swaptrade/incomeSwapTrade.js +++ b/YLErpWeb/wwwroot/Scripts/app/swaptrade/incomeSwapTrade.js @@ -63,8 +63,8 @@ const vue = new Vue({ this.floatPosition.Quantity = otcformat.trading.notional(this.floatPosition.Quantity); this.floatPosition.PositionQty = otcformat.trading.notional(this.floatPosition.PositionQty); this.deal.SwapCloseAmount = otcformat.trading.StockEqvNotional(this.deal.SwapCloseAmount); - this.floatPosition.PosiNetPrice = otcformat.trading.umprice(this.floatPosition.PosiNetPrice); - this.floatPosition.PosiGrossPrice = otcformat.trading.umprice(this.floatPosition.PosiGrossPrice); + //this.floatPosition.PosiNetPrice = otcformat.trading.umprice(this.floatPosition.PosiNetPrice); + //this.floatPosition.PosiGrossPrice = otcformat.trading.umprice(this.floatPosition.PosiGrossPrice); this.floatPosition.TradingFee = otcformat.trading.StockEqvNotional(this.floatPosition.TradingFee); this.floatPosition.DividendIn = otcformat.trading.StockEqvNotional(this.floatPosition.DividendIn); this.floatPosition.MarkClosePnl = otcformat.trading.StockEqvNotional(this.floatPosition.MarkClosePnl); diff --git a/YLErpWeb/wwwroot/Scripts/app/swaptrade/unwindSwapTrade.js b/YLErpWeb/wwwroot/Scripts/app/swaptrade/unwindSwapTrade.js index 1a409077..eb16694c 100644 --- a/YLErpWeb/wwwroot/Scripts/app/swaptrade/unwindSwapTrade.js +++ b/YLErpWeb/wwwroot/Scripts/app/swaptrade/unwindSwapTrade.js @@ -76,8 +76,8 @@ const vue = new Vue({ this.deal.CloseQty = otcformat.trading.notional(this.deal.CloseQty); this.deal.ClosePercent = otcformat.fixed6(this.deal.ClosePercent); this.deal.SwapCloseAmount = otcformat.trading.StockEqvNotional(this.deal.SwapCloseAmount); - this.floatPosition.PosiNetPrice = otcformat.trading.tradeSinglePrice(this.floatPosition.PosiNetPrice); - this.floatPosition.PosiGrossPrice = otcformat.trading.tradeSinglePrice(this.floatPosition.PosiGrossPrice); + //this.floatPosition.PosiNetPrice = otcformat.trading.tradeSinglePrice(this.floatPosition.PosiNetPrice); + //this.floatPosition.PosiGrossPrice = otcformat.trading.tradeSinglePrice(this.floatPosition.PosiGrossPrice); this.floatPosition.TradingAmountAvg = otcformat.trading.tradeSinglePrice(this.floatPosition.TradingAmountAvg); this.floatPosition.TradingFee = otcformat.trading.StockEqvNotional(this.floatPosition.TradingFee); this.floatPosition.TradingFeePending = otcformat.trading.StockEqvNotional(this.floatPosition.TradingFeePending); diff --git a/YLErpWeb/wwwroot/Style/Css/swapTradeEditV2.css b/YLErpWeb/wwwroot/Style/Css/swapTradeEditV2.css index 889c82c4..f128200d 100644 --- a/YLErpWeb/wwwroot/Style/Css/swapTradeEditV2.css +++ b/YLErpWeb/wwwroot/Style/Css/swapTradeEditV2.css @@ -194,7 +194,7 @@ li > input { } .swapflowtr input, .swapflowtr select { - width: 91px; + width: 113px; } .swappay, .swappay select { From 8aaccf7fc2a6b174a4648c71b0747e7d7afafe08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=B9=E6=B5=B7?= Date: Fri, 29 May 2026 13:34:45 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=94=B6=E7=9B=98?= =?UTF-8?q?=E5=BD=93=E5=A4=A9=E6=9C=89=E9=83=A8=E5=88=86=E5=B9=B3=E4=BB=93?= =?UTF-8?q?=E6=83=85=E5=86=B5=E5=88=A9=E6=81=AF=E4=B8=8D=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs b/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs index ef390988..05114ea3 100644 --- a/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs @@ -977,6 +977,7 @@ namespace YLErp.Modules.SwapModule newEodPayPosition.TdInterestFee = flowEvents.Sum(s => s.InterestFee); newEodPayPosition.TdCloseInterestFee = newEodPayPosition.TdInterestFee; newEodPayPosition.TdCloseInterest = flowEvents.Sum(s => s.InterestClosePnL); + newEodPayPosition.TdInterestIncome = TdInterestAmount * (1 - closePercent); Log.Info($"InterestIncomeSum is {eodPayPosition.InterestIncomeSum},TdInterestIncome is {newEodPayPosition.TdInterestIncome}" + $",TdCloseInterest is {newEodPayPosition.TdCloseInterest}"); Log.Info($"InterestFeeSum is {eodPayPosition.InterestFeeSum},TdInterestFee is {newEodPayPosition.TdInterestFee}" + @@ -987,10 +988,9 @@ namespace YLErp.Modules.SwapModule } else { - newEodPayPosition.InterestIncomeSum = eodPayPosition.InterestIncomeSum + TdInterestAmount - newEodPayPosition.TdCloseInterest * ratio; + newEodPayPosition.InterestIncomeSum = eodPayPosition.InterestIncomeSum + newEodPayPosition.TdInterestIncome - newEodPayPosition.TdCloseInterest * ratio; } //持仓内容-利息腿-损益统计(本方视角) - newEodPayPosition.TdInterestIncome = TdInterestAmount * (1 - closePercent); newEodPayPosition.InterestFeeSum = eodPayPosition.InterestFeeSum + newEodPayPosition.TdInterestFee - newEodPayPosition.TdCloseInterestFee; newEodPayPosition.InterestProfitSum = newEodPayPosition.InterestIncomeSum + newEodPayPosition.InterestFeeSum; //持仓价值 From d8747274e1fdc504afc73de712036694a6c29beb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=B9=E6=B5=B7?= Date: Fri, 29 May 2026 13:47:43 +0800 Subject: [PATCH 07/10] =?UTF-8?q?#EQD-6101=20=E5=9B=BD=E8=81=94=E6=B0=91?= =?UTF-8?q?=E7=94=9F&=E6=B5=99=E5=95=86-=E4=BA=92=E6=8D=A2=E5=B9=B3?= =?UTF-8?q?=E4=BB=93=E5=90=8E=E6=8F=90=E4=BA=A4=E4=B8=A4=E6=AC=A1=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E4=BC=9A=E5=87=BA=E7=8E=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YLErpDAL/Modules/TradeModule/DealModule/TradeUnwindService.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/YLErpDAL/Modules/TradeModule/DealModule/TradeUnwindService.cs b/YLErpDAL/Modules/TradeModule/DealModule/TradeUnwindService.cs index 7380b1c1..94fe5d3e 100644 --- a/YLErpDAL/Modules/TradeModule/DealModule/TradeUnwindService.cs +++ b/YLErpDAL/Modules/TradeModule/DealModule/TradeUnwindService.cs @@ -1833,6 +1833,10 @@ namespace YLErp.Modules.TradeModule.DealModule td.OptId = UserId; td.OptName = UserName; td.OptDate = OptDate; + if (td.TradeStatus!=ConsTrade.确认成交) + { + throw new Exception("当前交易状态不是确认成交"); + } if (isSwap) { td.TradeStatus = ConsTrade.互换待复核; From 53c89f1e2699f8c866a0a3e33dd767550cb59b18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=B9=E6=B5=B7?= Date: Fri, 29 May 2026 14:00:23 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E5=BD=93=E6=97=A5=E5=A4=9A=E6=AC=A1?= =?UTF-8?q?=E5=B9=B3=E4=BB=93=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YLErpDAL/Modules/SwapModule/SwapDealService.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/YLErpDAL/Modules/SwapModule/SwapDealService.cs b/YLErpDAL/Modules/SwapModule/SwapDealService.cs index 9b6b3e53..6096a395 100644 --- a/YLErpDAL/Modules/SwapModule/SwapDealService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapDealService.cs @@ -1,5 +1,6 @@ using MoreLinq.Extensions; using Newtonsoft.Json; +using Qdp.Pricing.Library.Base.Utilities; using System.Linq.Expressions; using YLErp.BLL; using YLErp.BLL.Eod; @@ -330,8 +331,20 @@ namespace YLErp.Modules.SwapModule var posiNotionalValue = stockEqvNotional * closePercent;//剩余名义本金 var orginPv = lastEod != null ? lastEod.NotionalValue : stockEqvNotional; var grossPrice = realPostitions.Where(x => x.PosiDirection > 0).FirstOrDefault()?.PosiGrossPrice; - bool tdClose = DbContext.swap_flow_event.Any(x => x.SwapTradeId == tradeId && x.UnwindDate == unwindDate && eventTypes.Contains(x.EventType) && x.DataState == (int)SwapFlowDateStateEnum.完成); + var closeList = DbContext.swap_flow_event.Where(x => x.SwapTradeId == tradeId && x.UnwindDate == unwindDate && eventTypes.Contains(x.EventType) && x.DataState == (int)SwapFlowDateStateEnum.完成).ToList(); + bool tdClose = closeList.Count > 0; interests = GetInterests(td, tradeExtend, valueDate, unwindDate, lastEodPositions, positions, stockEqvNotional, posiLongNotionalValue, posiShortNotionalValue, posiNotionalValue, closePercent, eventType, tdClose, false, grossPrice ?? 0, orginPv, true, false); + //当日有平仓或互换记录时,需要把平仓或互换已经结算的利息从计算结果中扣除,避免重复计算 + foreach (var item in interests) + { + var closeEvent = closeList.Where(x => x.PositionId == item.PositionId); + var closePnl = closeEvent.Sum(s=>s.InterestClosePnL); + var closeAmount = closeEvent.Sum(s=>s.InterestAmount); + var closeTdAmount= closeEvent.Sum(s=>s.TdInterestAmount); + item.InterestAmount=item.InterestAmount-closeAmount; + item.TdInterestAmount=item.TdInterestAmount-closeTdAmount; + item.InterestClosePnL= item.InterestClosePnL-closePnl; + } return interests; } /// From 4e53f822ab9cd483660b39f3a4dc18e87a95a7ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=B9=E6=B5=B7?= Date: Fri, 29 May 2026 14:39:44 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E7=9B=98=E4=B8=AD=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=B9=B3=E4=BB=93=E9=80=BB=E8=BE=91=E6=8C=AA=E5=88=B0=E5=86=85?= =?UTF-8?q?=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/SwapModule/SwapDealService.cs | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/YLErpDAL/Modules/SwapModule/SwapDealService.cs b/YLErpDAL/Modules/SwapModule/SwapDealService.cs index 6096a395..8772ad0c 100644 --- a/YLErpDAL/Modules/SwapModule/SwapDealService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapDealService.cs @@ -333,18 +333,7 @@ namespace YLErp.Modules.SwapModule var grossPrice = realPostitions.Where(x => x.PosiDirection > 0).FirstOrDefault()?.PosiGrossPrice; var closeList = DbContext.swap_flow_event.Where(x => x.SwapTradeId == tradeId && x.UnwindDate == unwindDate && eventTypes.Contains(x.EventType) && x.DataState == (int)SwapFlowDateStateEnum.完成).ToList(); bool tdClose = closeList.Count > 0; - interests = GetInterests(td, tradeExtend, valueDate, unwindDate, lastEodPositions, positions, stockEqvNotional, posiLongNotionalValue, posiShortNotionalValue, posiNotionalValue, closePercent, eventType, tdClose, false, grossPrice ?? 0, orginPv, true, false); - //当日有平仓或互换记录时,需要把平仓或互换已经结算的利息从计算结果中扣除,避免重复计算 - foreach (var item in interests) - { - var closeEvent = closeList.Where(x => x.PositionId == item.PositionId); - var closePnl = closeEvent.Sum(s=>s.InterestClosePnL); - var closeAmount = closeEvent.Sum(s=>s.InterestAmount); - var closeTdAmount= closeEvent.Sum(s=>s.TdInterestAmount); - item.InterestAmount=item.InterestAmount-closeAmount; - item.TdInterestAmount=item.TdInterestAmount-closeTdAmount; - item.InterestClosePnL= item.InterestClosePnL-closePnl; - } + interests = GetInterests(td, tradeExtend, valueDate, unwindDate, lastEodPositions, positions, stockEqvNotional, posiLongNotionalValue, posiShortNotionalValue, posiNotionalValue, closePercent, eventType, tdClose, false, grossPrice ?? 0, orginPv, true, false, closeList); return interests; } /// @@ -382,7 +371,8 @@ namespace YLErp.Modules.SwapModule decimal grossPrice, decimal orginPv, bool add = false, - bool settment = true) + bool settment = true, + List closeList = null) { List interests = new List(); var annualDays = tradeExtend == null ? 365 : tradeExtend.ExtendObj.AnnualDays; @@ -422,6 +412,20 @@ namespace YLErp.Modules.SwapModule interests.Add(CalcUnwindInterest(td, valueDate, endDate, positionClone, rate, floatRate, posiPrincipal, closePrincipal, newClosePercent, annualDays, preEodPosition, eventType, add, swap, orginPv, calcFirst, calcLast)); } } + //当日有平仓或互换记录时,需要把平仓或互换已经结算的利息从计算结果中扣除,避免重复计算 + if (closeList != null && closeList.Count > 0) + { + foreach (var item in interests) + { + var closeEvent = closeList.Where(x => x.PositionId == item.PositionId); + var closePnl = closeEvent.Sum(s => s.InterestClosePnL); + var closeAmount = closeEvent.Sum(s => s.InterestAmount); + var closeTdAmount = closeEvent.Sum(s => s.TdInterestAmount); + item.InterestAmount = item.InterestAmount - closeAmount; + item.TdInterestAmount = item.TdInterestAmount - closeTdAmount; + item.InterestClosePnL = item.InterestClosePnL - closePnl; + } + } return interests; } From 1932a2e7576cf0da9979cc5ec470cb45c525068a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=B9=E6=B5=B7?= Date: Fri, 29 May 2026 16:20:41 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YLErpWeb/App_Data/Config/otcformat.js | 126 +------------------------- 1 file changed, 1 insertion(+), 125 deletions(-) diff --git a/YLErpWeb/App_Data/Config/otcformat.js b/YLErpWeb/App_Data/Config/otcformat.js index c9f9202a..92b1f226 100644 --- a/YLErpWeb/App_Data/Config/otcformat.js +++ b/YLErpWeb/App_Data/Config/otcformat.js @@ -1,126 +1,2 @@ var main = main || {}; -main.formatOptions= { - "trading": { - "umprice": { - "precision": 9, - "grouping": true, - "rounded": true, - "percent": false, - "minDecimals": 9, - "maxDecimals": 0 - }, - "umpriceP": { - "percent": true, - "precision": 2, - "grouping": false, - "rounded": true, - "minDecimals": 2, - "maxDecimals": 0 - }, - "umpricePR": { - "precision": 4, - "grouping": false, - "rounded": true, - "percent": false, - "minDecimals": 4, - "maxDecimals": 2 - }, - "tradeSinglePrice": { - "precision": 2, - "grouping": true, - "rounded": true, - "percent": false, - "minDecimals": 2, - "maxDecimals": 0 - }, - "premiumRateP": { - "percent": true, - "precision": 2, - "grouping": false, - "rounded": true, - "minDecimals": 2, - "maxDecimals": 0 - }, - "premiumRate": { - "precision": 4, - "grouping": false, - "rounded": true, - "percent": false, - "minDecimals": 4, - "maxDecimals": 2 - }, - "tradePrice": { - "precision": 2, - "grouping": false, - "rounded": true, - "percent": false, - "minDecimals": 2, - "maxDecimals": 0 - }, - "StockEqvNotional": { - "precision": 2, - "grouping": true, - "rounded": true, - "percent": false, - "minDecimals": 2, - "maxDecimals": 0 - }, - "notional": { - "precision": 2, - "grouping": true, - "rounded": true, - "percent": false, - "minDecimals": 2, - "maxDecimals": 0 - }, - "notionalP": { - "percent": true, - "precision": 2, - "grouping": false, - "rounded": true, - "minDecimals": 2, - "maxDecimals": 0 - }, - "volatility": { - "precision": 4, - "grouping": false, - "rounded": true, - "percent": false, - "minDecimals": 4, - "maxDecimals": 2 - }, - "volatilityP": { - "percent": true, - "precision": 2, - "grouping": false, - "rounded": true, - "minDecimals": 2, - "maxDecimals": 0 - }, - "greek": { - "precision": 2, - "grouping": false, - "rounded": true, - "percent": false, - "minDecimals": 2, - "maxDecimals": 0 - }, - "marginRateP": { - "percent": true, - "precision": 2, - "grouping": false, - "rounded": true, - "minDecimals": 2, - "maxDecimals": 0 - }, - "marginRate": { - "precision": 4, - "grouping": false, - "rounded": true, - "percent": false, - "minDecimals": 4, - "maxDecimals": 2 - } - } -}; - +main.formatOptions = { "trading": { "umprice": { "trimTailZeros": true, "precision": 9, "grouping": true, "rounded": true, "percent": false, "minDecimals": 2, "maxDecimals": 9 }, "umpriceP": { "trimTailZeros": true, "percent": true, "precision": 9, "grouping": false, "rounded": true, "minDecimals": 2, "maxDecimals": 9 }, "umpricePR": { "trimTailZeros": true, "precision": 9, "grouping": false, "rounded": true, "percent": false, "minDecimals": 2, "maxDecimals": 9 }, "tradeSinglePrice": { "trimTailZeros": true, "precision": 9, "grouping": true, "rounded": true, "percent": false, "minDecimals": 2, "maxDecimals": 9 }, "premiumRateP": { "trimTailZeros": true, "percent": true, "precision": 9, "grouping": false, "rounded": true, "minDecimals": 2, "maxDecimals": 9 }, "premiumRate": { "trimTailZeros": true, "precision": 9, "grouping": false, "rounded": true, "percent": false, "minDecimals": 2, "maxDecimals": 9 }, "tradePrice": { "trimTailZeros": true, "precision": 9, "grouping": false, "rounded": true, "percent": false, "minDecimals": 2, "maxDecimals": 9 }, "StockEqvNotional": { "trimTailZeros": true, "precision": 9, "grouping": true, "rounded": true, "percent": false, "minDecimals": 2, "maxDecimals": 9 }, "notional": { "trimTailZeros": true, "precision": 9, "grouping": true, "rounded": true, "percent": false, "minDecimals": 2, "maxDecimals": 9 }, "notionalP": { "trimTailZeros": true, "percent": true, "precision": 9, "grouping": false, "rounded": true, "minDecimals": 2, "maxDecimals": 9 }, "volatility": { "trimTailZeros": true, "precision": 9, "grouping": false, "rounded": true, "percent": false, "minDecimals": 2, "maxDecimals": 9 }, "volatilityP": { "trimTailZeros": true, "percent": true, "precision": 9, "grouping": false, "rounded": true, "minDecimals": 2, "maxDecimals": 9 }, "greek": { "trimTailZeros": true, "precision": 9, "grouping": false, "rounded": true, "percent": false, "minDecimals": 2, "maxDecimals": 9 }, "marginRateP": { "trimTailZeros": true, "percent": true, "precision": 9, "grouping": false, "rounded": true, "minDecimals": 2, "maxDecimals": 9 }, "marginRate": { "trimTailZeros": true, "precision": 9, "grouping": false, "rounded": true, "percent": false, "minDecimals": 2, "maxDecimals": 9 } } }; \ No newline at end of file