增加vega(1bp)希腊值

This commit is contained in:
尹峰
2026-08-20 14:15:12 +08:00
parent 30b3007307
commit 5ee510aa35
11 changed files with 110 additions and 18 deletions
@@ -1,4 +1,4 @@
$(function () {
$(function () {
var __jq = {
PostData: typeof PostData !== 'undefined' ? PostData : {},
@@ -259,6 +259,13 @@ function ResetEditPanel(model) {
calcQuotaNameChecked.push(model.CalcQuota[i].Name);
}
}
// 编辑旧模板时,把模板未包含的新增指标(如 Vega(1bp))追加到勾选列表末尾,默认不勾选,保证与新增模板口径一致
var defaultQuota = pageObj && pageObj.DefaultQuota ? pageObj.DefaultQuota.CalcQuota : [];
for (var j = 0; j < defaultQuota.length; j++) {
if (!quotaOrder.includes(defaultQuota[j].Name)) {
quotaOrder.push(defaultQuota[j].Name);
}
}
InitQuotaCheckList(quotaOrder);
if (calcQuotaNameChecked != null && calcQuotaNameChecked.length > 0) {
@@ -559,6 +559,15 @@ function getColModelGrid() {
sortIndex: i++,
formatter: greeksFormat,
sortable: false
}, {
name: 'Vega_1bp',
label: 'Vega(1bp)',
index: 'Vega_1bp',
width: 100,
align: 'center',
sortIndex: i++,
formatter: greeksFormat,
sortable: false
},);
}
@@ -664,7 +673,7 @@ function TradeAmountFormat(cellValue, options, rowObject) {
}
function greeksFormat(cellValue, options, rowObject) {
if (cellValue) {
if (cellValue != null) {
return otcformat.trading.greek(cellValue);
}
return "";
@@ -214,7 +214,7 @@ const vueMarginTemplateName = function () {
}
//计算结果字段
const consCalcFields = Object.freeze(['TotalMargin', 'Pv', 'Delta', 'Gamma', 'Vega', 'Theta', 'Rho', 'PvContainsKnockOut', 'DeltaContainsKnockOut', 'DeltaInLots', 'GammaInLots', 'DeltaCash', 'GammaCash', 'VegaCash', 'GammaContainsKnockOut', 'Delta_r', 'Delta_r_1bp', 'Dv01', 'Gamma_r', 'Gamma_r_1bp', 'Vega_r', 'Vega_r_1bp']);
const consCalcFields = Object.freeze(['TotalMargin', 'Pv', 'Delta', 'Gamma', 'Vega', 'Theta', 'Rho', 'PvContainsKnockOut', 'DeltaContainsKnockOut', 'DeltaInLots', 'GammaInLots', 'DeltaCash', 'GammaCash', 'VegaCash', 'GammaContainsKnockOut', 'Delta_r', 'Delta_r_1bp', 'Dv01', 'Gamma_r', 'Gamma_r_1bp', 'Vega_r', 'Vega_r_1bp', 'Vega_1bp']);
var _trades, _tradeVues, _salesCommissionCtrl;
//交易保存
@@ -1913,13 +1913,14 @@ function createVue(index, baseVue, floating) {
calcResult.PvContainsKnockOut = pricingFormat.tradePrice(result.PvContainsKnockOut);
calcResult.DeltaContainsKnockOut = pricingFormat.greek(result.DeltaContainsKnockOut);
calcResult.GammaContainsKnockOut = pricingFormat.greek(result.GammaContainsKnockOut);
calcResult.Delta_r = result.Delta_r ? pricingFormat.greek(result.Delta_r) : "";
calcResult.Delta_r_1bp = result.Delta_r_1bp ? pricingFormat.greek(result.Delta_r_1bp) : "";
calcResult.Dv01 = result.Dv01 ? pricingFormat.greek(result.Dv01) : "";
calcResult.Gamma_r = result.Gamma_r ? pricingFormat.greek(result.Gamma_r) : "";
calcResult.Gamma_r_1bp = result.Gamma_r_1bp ? pricingFormat.greek(result.Gamma_r_1bp) : "";
calcResult.Vega_r = result.Vega_r ? pricingFormat.greek(result.Vega_r) : "";
calcResult.Vega_r_1bp = result.Vega_r_1bp ? pricingFormat.greek(result.Vega_r_1bp) : "";
calcResult.Delta_r = result.Delta_r != null ? pricingFormat.greek(result.Delta_r) : "";
calcResult.Delta_r_1bp = result.Delta_r_1bp != null ? pricingFormat.greek(result.Delta_r_1bp) : "";
calcResult.Dv01 = result.Dv01 != null ? pricingFormat.greek(result.Dv01) : "";
calcResult.Gamma_r = result.Gamma_r != null ? pricingFormat.greek(result.Gamma_r) : "";
calcResult.Gamma_r_1bp = result.Gamma_r_1bp != null ? pricingFormat.greek(result.Gamma_r_1bp) : "";
calcResult.Vega_r = result.Vega_r != null ? pricingFormat.greek(result.Vega_r) : "";
calcResult.Vega_r_1bp = result.Vega_r_1bp != null ? pricingFormat.greek(result.Vega_r_1bp) : "";
calcResult.Vega_1bp = result.Vega_1bp != null ? pricingFormat.greek(result.Vega_1bp) : "";
calcResult.TotalMargin = 0;
if (data === this.datas[this.datas.length - 1]) {
calcResult.TotalMargin = pageVue.GetTotalMargin(_.map(this.datas, x => x.trade), this.structureType);