期初标的价格(债券的)希望是小数点9位问题
This commit is contained in:
@@ -62,7 +62,7 @@ namespace YLErp
|
||||
/// 价格四舍五入保留位数
|
||||
/// </summary>
|
||||
|
||||
public const int PriceRound = 10;
|
||||
public const int PriceRound = 11;
|
||||
/// <summary>
|
||||
/// 金额四舍五入保留位数
|
||||
/// </summary>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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}}};
|
||||
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
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
-1
@@ -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}}};
|
||||
@@ -146,7 +146,7 @@
|
||||
<td>{{priceFormat(floatPosition.PosiGrossPrice)}}</td>
|
||||
<td>{{priceFormat(floatPosition.TradingAmountNetAvg)}}</td>
|
||||
<td>
|
||||
<vue-number-input v-model="floatPosition.TradingAmountAvg" v-bind:format="inputFormatEqvNotional" v-on:input="changeUnderlyingPrice"></vue-number-input>
|
||||
<vue-number-input v-model="floatPosition.TradingAmountAvg" v-bind:format="inputFormatEqvNotional" v-on:input="changeUnderlyingPrice" style="width:107px;"></vue-number-input>
|
||||
<input class="text-box" v-model="floatPosition.TradingAmountAvg" v-on:blur="changeUnderlyingPrice" type="number" min="0" v-else />
|
||||
<a href="javascript:void(0)" v-on:click="refreshUnderlyingPrice()">
|
||||
<span title="使用系统标的价格" class="glyphicon glyphicon-refresh"></span>
|
||||
|
||||
@@ -197,7 +197,7 @@
|
||||
</td>
|
||||
<td>{{priceFormat(floatPosition.PosiGrossPrice)}}</td>
|
||||
<td>
|
||||
<vue-number-input v-model="floatPosition.TradingAmountAvg" v-bind:format="inputFormatEqvNotional" v-on:input="changeUnderlyingPrice"></vue-number-input>
|
||||
<vue-number-input v-model="floatPosition.TradingAmountAvg" v-bind:format="inputFormatEqvNotional" v-on:input="changeUnderlyingPrice" style="width:107px;"></vue-number-input>
|
||||
<a href="javascript:void(0)" v-on:click="refreshUnderlyingPrice()">
|
||||
<span title="使用系统标的价格" class="glyphicon glyphicon-refresh"></span>
|
||||
</a>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -194,7 +194,7 @@ li > input {
|
||||
}
|
||||
|
||||
.swapflowtr input, .swapflowtr select {
|
||||
width: 91px;
|
||||
width: 113px;
|
||||
}
|
||||
|
||||
.swappay, .swappay select {
|
||||
|
||||
Reference in New Issue
Block a user