!28 登录界面美化
Merge pull request !28 from feature/p132_154-yf-new-sso-login
This commit is contained in:
@@ -20,7 +20,7 @@ namespace YLErp.Web
|
||||
|
||||
GlobalConfig.EnableGenerateOnTradeClosed = true;
|
||||
GlobalConfig.OverrideOldDoc = true;
|
||||
GlobalConfig.ProjectTitle = "场外衍生品交易管理系统";
|
||||
GlobalConfig.ProjectTitle = "固收场外衍生品系统";
|
||||
GlobalConfig.GetNameByUserId = UserBLL.GetNameById;
|
||||
GlobalConfig.SealHandler = new SealTaskHandleService(OptUserInfo.SystemUser);
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace YLErp.Web.Controllers
|
||||
// 如果上次登录失败,则显示验证码输入,否则不需要
|
||||
//---------------------------------------
|
||||
|
||||
[ResponseCache(NoStore = true)]
|
||||
public ActionResult Login(bool skipSso = false)
|
||||
{
|
||||
var logger = LogFactory.GetLogger<AccountController>();
|
||||
@@ -69,7 +70,7 @@ namespace YLErp.Web.Controllers
|
||||
// 注意:DisablePasswordLogin 的逻辑在 Login.cshtml 视图中处理
|
||||
// 这里不再直接跳转,而是显示登录页,由页面决定显示什么内容
|
||||
|
||||
return LoginError(null);
|
||||
return View();
|
||||
}
|
||||
|
||||
public ActionResult Login2()
|
||||
@@ -77,6 +78,14 @@ namespace YLErp.Web.Controllers
|
||||
return Login(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内置超管账密登录兜底页
|
||||
/// </summary>
|
||||
public ActionResult AdminLogin()
|
||||
{
|
||||
return LoginError(null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 登录错误
|
||||
/// </summary>
|
||||
@@ -113,7 +122,7 @@ namespace YLErp.Web.Controllers
|
||||
model.SID = DataProtectHelper.Encrypt(sid);
|
||||
}
|
||||
|
||||
return View(nameof(Login), model);
|
||||
return View(nameof(AdminLogin), model);
|
||||
}
|
||||
|
||||
[HttpPost, ResponseCache(NoStore = true)]
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
@model LogOnModel
|
||||
|
||||
@{
|
||||
Layout = null;
|
||||
ViewBag.Title = "登录";
|
||||
var captchaUrl = Url.Action("Captcha") + "?sid=" + Model.SID;
|
||||
Model.LoadTime = DateTime.Now;
|
||||
var disablePasswordLogin = PS.Config?.ErpElement?.DisablePasswordLogin ?? false;
|
||||
var ssoEnable = YLErp.Web.Models.GeneralSSOConfig.Enable;
|
||||
}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html style="height:100%">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>@GlobalConfig.ProjectTitle</title>
|
||||
<link rel="stylesheet" href="~/statics/bundles/bundle.min.css?v=@(HtmlUtil.JsVersion)">
|
||||
<style>
|
||||
.login-container { position: relative; width: 100%; height: 100%; background-image: url(../../Statics/images/loginBackgroundImag.jpg); background-repeat: no-repeat; background-size: cover; }
|
||||
.ms-title { width: 100%; line-height: 50px; text-align: center; font-size: 20px; color: #fff; border-bottom: 1px solid #ddd }
|
||||
.ms-login { position: absolute; left: 50%; top: 50%; width: 350px; margin: -190px 0 0 -175px; border-radius: 5px; background: rgba(0,1,11,.32); overflow: hidden }
|
||||
.ms-content { padding: 30px }
|
||||
.login-table { width: 100%; }
|
||||
.login-table td { padding-bottom: 10px; }
|
||||
.login-input { width: 100% !important; height: 33.5px !important; text-align: left !important; }
|
||||
.login-btn { text-align: center; margin-bottom: 18px; height: 36px; width: 100%; }
|
||||
.btn-secondary { background-color: #6c757d; border-color: #6c757d; }
|
||||
.btn-secondary:hover { background-color: #5a6268; border-color: #545b62; }
|
||||
</style>
|
||||
<script src="~/Statics/libs/jquery/jquery-3.5.1.min.js"></script>
|
||||
<script>
|
||||
$(function(){
|
||||
CaptchaClick();
|
||||
})
|
||||
function CaptchaClick(){
|
||||
var img = document.getElementById('captcha');
|
||||
if (!img) return; // NeedCaptcha=false 时验证码 img 不渲染,避免 null.setAttribute 报错
|
||||
var newSrc = '@captchaUrl' + '&t=' + new Date().getTime();
|
||||
img.setAttribute('src', newSrc);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body style="height:100%">
|
||||
<div class="login-container">
|
||||
<div class="login-top">
|
||||
<div class="login-logo">
|
||||
@switch (YLErp.PS.Config.Company)
|
||||
{
|
||||
case YLErp.Configuration.CompanyEnum.申万:
|
||||
<img src="/Images/sywg/maincenter.png" style="width: 300px;" />
|
||||
break;
|
||||
default:
|
||||
<img src="/Images/loginlogo.png" style="height:150px" />
|
||||
break;
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="ms-login">
|
||||
<div class="ms-title">@GlobalConfig.ProjectTitle</div>
|
||||
@if (disablePasswordLogin)
|
||||
{
|
||||
<!-- 禁用密码登录,只显示SSO按钮 -->
|
||||
<div class="ms-content" style="text-align: center; padding: 40px 30px;">
|
||||
<p style="color: #fff; margin-bottom: 20px;">请使用飞连登录</p>
|
||||
@if (ssoEnable)
|
||||
{
|
||||
<a href="@YLErp.Web.Models.GeneralSSOConfig.AuthUrl" class="btn btn-primary login-btn" style="background-color: #1890ff; border-color: #1890ff;">飞连登录</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<p style="color: #ff6b6b;">SSO登录未配置,请联系管理员</p>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<!-- 正常登录表单 -->
|
||||
<form id="form1" action="/Account/LoginHandle?g=@(Guid.NewGuid())" method="post" class="ms-content">
|
||||
<input type="hidden" name="SID" value="@(Model.SID)" />
|
||||
<input type="hidden" name="UserName" id="UserName" />
|
||||
<input type="hidden" name="Password" id="Password" />
|
||||
<input type="hidden" name="LoadTime" value="@(Model.LoadTime.ToString("yyyy-MM-dd HH:mm:ss"))" />
|
||||
|
||||
<table class="login-table">
|
||||
<colgroup>
|
||||
<col span="1" width="30" />
|
||||
</colgroup>
|
||||
<tr>
|
||||
<td><img src="~/Images/username.png" /></td>
|
||||
<td><input type="text" class="form-control login-input" id="UserName2" placeholder="用户名" autocomplete="off" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="~/Images/password.png" /></td>
|
||||
<td>
|
||||
<!--阻止chrome浏览器自动填充-->
|
||||
<input type="password" style="display:none" />
|
||||
<input type="password" class="form-control login-input" id="Password2" placeholder="密码" autocomplete="new-password" />
|
||||
</td>
|
||||
</tr>
|
||||
@if (Model.NeedCaptcha)
|
||||
{
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<input type="text" name="CaptchaCode" id="CaptchaCode" class="form-control login-input mb-2" placeholder="输入验证码" autocomplete="off" />
|
||||
<img onclick="CaptchaClick()" style="cursor:pointer;" id="captcha" />
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<p id="errMsg" style="color:red;">@Html.Raw(Model?.ErrorMessage)</p>
|
||||
<button id="sbumitbtn" type="submit" class="btn btn-primary login-btn">登 录</button>
|
||||
@if (ssoEnable)
|
||||
{
|
||||
<a href="@YLErp.Web.Models.GeneralSSOConfig.AuthUrl" class="btn btn-secondary login-btn">飞连登录</a>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
}
|
||||
<div style="text-align:center;margin-bottom:1rem">
|
||||
Copyright © 2020 YieldChain All rights reserved.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display:none">@(Model.Exception?.ToString())</div>
|
||||
|
||||
<script>
|
||||
|
||||
function encode(content) {
|
||||
var result = [];
|
||||
for (var i = 0; i < content.length; i++) {
|
||||
result.push(content.charCodeAt(i));
|
||||
}
|
||||
return btoa(result);
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
var userName = $('#UserName2').val();
|
||||
var password = $('#Password2').val();
|
||||
if (!userName || !password) {
|
||||
$('#errMsg').text('用户名和密码必须填写');
|
||||
return false;
|
||||
}
|
||||
if ($('#CaptchaCode').length && !$('#CaptchaCode').val()) {
|
||||
$('#errMsg').text('请填写验证码');
|
||||
return false;
|
||||
}
|
||||
$('#UserName').val(encode(userName));
|
||||
$('#Password').val(encode(password));
|
||||
return true;
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$('#form1').on('submit', onSubmit);
|
||||
});
|
||||
|
||||
window.history.replaceState(null, null, "/Account/AdminLogin?g=@(Guid.NewGuid())");
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,12 +1,8 @@
|
||||
@model LogOnModel
|
||||
|
||||
@{
|
||||
Layout = null;
|
||||
ViewBag.Title = "登录";
|
||||
var captchaUrl = Url.Action("Captcha") + "?sid=" + Model.SID;
|
||||
Model.LoadTime = DateTime.Now;
|
||||
var disablePasswordLogin = PS.Config?.ErpElement?.DisablePasswordLogin ?? false;
|
||||
var ssoEnable = YLErp.Web.Models.GeneralSSOConfig.Enable;
|
||||
var authUrl = YLErp.Web.Models.GeneralSSOConfig.AuthUrl;
|
||||
}
|
||||
|
||||
<!DOCTYPE html>
|
||||
@@ -14,153 +10,96 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>@GlobalConfig.ProjectTitle</title>
|
||||
<link rel="stylesheet" href="~/statics/bundles/bundle.min.css?v=@(HtmlUtil.JsVersion)">
|
||||
<style>
|
||||
.login-container { position: relative; width: 100%; height: 100%; background-image: url(../../Statics/images/loginBackgroundImag.jpg); background-repeat: no-repeat; background-size: cover; }
|
||||
.ms-title { width: 100%; line-height: 50px; text-align: center; font-size: 20px; color: #fff; border-bottom: 1px solid #ddd }
|
||||
.ms-login { position: absolute; left: 50%; top: 50%; width: 350px; margin: -190px 0 0 -175px; border-radius: 5px; background: rgba(0,1,11,.32); overflow: hidden }
|
||||
.ms-content { padding: 30px }
|
||||
.login-table { width: 100%; }
|
||||
.login-table td { padding-bottom: 10px; }
|
||||
.login-input { width: 100% !important; height: 33.5px !important; text-align: left !important; }
|
||||
.login-btn { text-align: center; margin-bottom: 18px; height: 36px; width: 100%; }
|
||||
.btn-secondary { background-color: #6c757d; border-color: #6c757d; }
|
||||
.btn-secondary:hover { background-color: #5a6268; border-color: #545b62; }
|
||||
</style>
|
||||
<script src="~/Statics/libs/jquery/jquery-3.5.1.min.js"></script>
|
||||
<script>
|
||||
$(function(){
|
||||
CaptchaClick();
|
||||
})
|
||||
function CaptchaClick(){
|
||||
var img = document.getElementById('captcha');
|
||||
if (!img) return; // NeedCaptcha=false 时验证码 img 不渲染,避免 null.setAttribute 报错
|
||||
var newSrc = '@captchaUrl' + '&t=' + new Date().getTime();
|
||||
img.setAttribute('src', newSrc);
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
html, body { height: 100%; }
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
|
||||
color: #1F1F1F;
|
||||
background: #F2F2F2;
|
||||
background-image:
|
||||
radial-gradient(circle at 12% 18%, #EDE6E6 0%, rgba(237,230,230,0) 42%),
|
||||
radial-gradient(circle at 88% 82%, #E9E0E0 0%, rgba(233,224,224,0) 45%);
|
||||
}
|
||||
</script>
|
||||
.login-page { position: relative; min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 80px 24px 40px; }
|
||||
.login-main { margin: auto; width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; }
|
||||
.login-header { position: absolute; top: 30px; left: 34px; display: flex; align-items: center; gap: 10px; }
|
||||
.login-header .brand { font-size: 23px; letter-spacing: -0.055em; color: #1D1A1A; font-weight: 400; line-height: 1; }
|
||||
.login-header .brand b { font-weight: 800; color: #C0221E; }
|
||||
.login-header .sub { display: block; margin-top: 3px; font-size: 11px; letter-spacing: 0.055em; color: #938A8A; }
|
||||
.login-title { text-align: center; margin-bottom: 24px; }
|
||||
.login-title h1 { font-size: 24px; line-height: 36px; letter-spacing: -0.025em; color: #1F1F1F; font-weight: 700; }
|
||||
.login-title h1 .accent { color: #C0221E; font-weight: 800; letter-spacing: -0.04em; }
|
||||
.login-title p { margin-top: 8px; font-size: 13px; line-height: 19.5px; color: #ADADAD; }
|
||||
.login-card { width: 380px; max-width: 100%; padding: 36px 36px 32px; background: #FFFFFF; border-radius: 18px; box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 10px 48px rgba(0,0,0,.1); text-align: center; }
|
||||
.sso-icon { display: flex; align-items: center; justify-content: center; width: 80px; height: 80px; margin: 0 auto; border-radius: 40px; background: linear-gradient(135deg, #F5E8E8 0%, #F9E0E0 100%); box-shadow: 0 6px 24px rgba(192,34,30,.14); }
|
||||
.sso-icon img { width: 36px; height: 36px; }
|
||||
.sso-title { margin-top: 16px; font-size: 14px; font-weight: 600; line-height: 21px; color: #1F1F1F; }
|
||||
.sso-desc { margin-top: 4px; font-size: 12px; line-height: 19.2px; color: #ADADAD; }
|
||||
.sso-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 51px; margin-top: 32px; border: none; border-radius: 10px; background: #C0221E; box-shadow: 0 4px 18px rgba(192,34,30,.3); color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 0.04em; text-decoration: none; cursor: pointer; transition: opacity .2s; }
|
||||
.sso-btn:hover { opacity: .9; color: #fff; text-decoration: none; }
|
||||
.sso-btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; line-height: 0; }
|
||||
.sso-btn img { width: 17px; height: 17px; display: block; }
|
||||
.sso-btn-text { line-height: 1; }
|
||||
.sso-btn.disabled { background: #ccc; box-shadow: none; cursor: not-allowed; pointer-events: none; }
|
||||
.sso-btn.loading { background: #E04B48; box-shadow: 0 4px 18px rgba(192,34,30,.25); pointer-events: none; opacity: 1; color: #fff; }
|
||||
@@keyframes spin { to { transform: rotate(360deg); } }
|
||||
.sso-spinner { width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
|
||||
.sso-error { margin-top: 10px; font-size: 12px; color: #ff6b6b; }
|
||||
.admin-link { position: absolute; bottom: 16px; left: 24px; font-size: 12px; color: #ADADAD; text-decoration: none; }
|
||||
.admin-link:hover { color: #C0221E; }
|
||||
</style>
|
||||
</head>
|
||||
<body style="height:100%">
|
||||
<div class="login-container">
|
||||
<div class="login-top">
|
||||
<div class="login-logo">
|
||||
@switch (YLErp.PS.Config.Company)
|
||||
{
|
||||
case YLErp.Configuration.CompanyEnum.申万:
|
||||
<img src="/Images/sywg/maincenter.png" style="width: 300px;" />
|
||||
break;
|
||||
default:
|
||||
<img src="/Images/loginlogo.png" style="height:150px" />
|
||||
break;
|
||||
}
|
||||
<body>
|
||||
<div class="login-page">
|
||||
<div class="login-header">
|
||||
<img src="~/Images/login/LogoMark.svg" style="width:50px;height:50px;" alt="logo" />
|
||||
<div>
|
||||
<span class="brand">One<b>Deriv</b></span>
|
||||
<span class="sub">@GlobalConfig.ProjectTitle</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ms-login">
|
||||
<div class="ms-title">@GlobalConfig.ProjectTitle</div>
|
||||
@if (disablePasswordLogin)
|
||||
{
|
||||
<!-- 禁用密码登录,只显示SSO按钮 -->
|
||||
<div class="ms-content" style="text-align: center; padding: 40px 30px;">
|
||||
<p style="color: #fff; margin-bottom: 20px;">请使用飞连登录</p>
|
||||
@if (ssoEnable)
|
||||
{
|
||||
<a href="@YLErp.Web.Models.GeneralSSOConfig.AuthUrl" class="btn btn-primary login-btn" style="background-color: #1890ff; border-color: #1890ff;">飞连登录</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<p style="color: #ff6b6b;">SSO登录未配置,请联系管理员</p>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<!-- 正常登录表单 -->
|
||||
<form id="form1" action="/Account/LoginHandle?g=@(Guid.NewGuid())" method="post" class="ms-content">
|
||||
<input type="hidden" name="SID" value="@(Model.SID)" />
|
||||
<input type="hidden" name="UserName" id="UserName" />
|
||||
<input type="hidden" name="Password" id="Password" />
|
||||
<input type="hidden" name="LoadTime" value="@(Model.LoadTime.ToString("yyyy-MM-dd HH:mm:ss"))" />
|
||||
|
||||
<table class="login-table">
|
||||
<colgroup>
|
||||
<col span="1" width="30" />
|
||||
</colgroup>
|
||||
<tr>
|
||||
<td><img src="~/Images/username.png" /></td>
|
||||
<td><input type="text" class="form-control login-input" id="UserName2" placeholder="用户名" autocomplete="off" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="~/Images/password.png" /></td>
|
||||
<td>
|
||||
<!--阻止chrome浏览器自动填充-->
|
||||
<input type="password" style="display:none" />
|
||||
<input type="password" class="form-control login-input" id="Password2" placeholder="密码" autocomplete="new-password" />
|
||||
</td>
|
||||
</tr>
|
||||
@if (Model.NeedCaptcha)
|
||||
{
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<input type="text" name="CaptchaCode" id="CaptchaCode" class="form-control login-input mb-2" placeholder="输入验证码" autocomplete="off" />
|
||||
<img onclick="CaptchaClick()" style="cursor:pointer;" id="captcha" />
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<p id="errMsg" style="color:red;">@Html.Raw(Model?.ErrorMessage)</p>
|
||||
<button id="sbumitbtn" type="submit" class="btn btn-primary login-btn">登 录</button>
|
||||
@if (ssoEnable)
|
||||
{
|
||||
<a href="@YLErp.Web.Models.GeneralSSOConfig.AuthUrl" class="btn btn-secondary login-btn" target="_blank">飞连登录</a>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
}
|
||||
<div style="text-align:center;margin-bottom:1rem">
|
||||
Copyright © 2020 YieldChain All rights reserved.
|
||||
<div class="login-main">
|
||||
<div class="login-title">
|
||||
<h1>欢迎登录 <span class="accent">OneDeriv</span></h1>
|
||||
<p>@GlobalConfig.ProjectTitle</p>
|
||||
</div>
|
||||
|
||||
<div class="login-card">
|
||||
<div class="sso-icon"><img src="~/Images/login/Icon.svg" alt="feishu" /></div>
|
||||
<div class="sso-title">一键跳转飞连认证</div>
|
||||
<div class="sso-desc">系统将跳转至飞连身份认证中心<br />完成验证后自动返回</div>
|
||||
@if (ssoEnable)
|
||||
{
|
||||
<a id="ssoBtn" class="sso-btn" href="@authUrl">
|
||||
<span class="sso-btn-icon"><img src="~/Images/login/IconBolt.svg" alt="bolt" /></span>
|
||||
<span class="sso-btn-text">飞连 SSO 登录</span>
|
||||
</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a class="sso-btn disabled">飞连 SSO 登录</a>
|
||||
<p class="sso-error">SSO 登录未配置,请联系管理员</p>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display:none">@(Model.Exception?.ToString())</div>
|
||||
|
||||
<a class="admin-link" href="/Account/AdminLogin">旧版登录</a>
|
||||
<script>
|
||||
|
||||
function encode(content) {
|
||||
var result = [];
|
||||
for (var i = 0; i < content.length; i++) {
|
||||
result.push(content.charCodeAt(i));
|
||||
}
|
||||
return btoa(result);
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
var userName = $('#UserName2').val();
|
||||
var password = $('#Password2').val();
|
||||
if (!userName || !password) {
|
||||
$('#errMsg').text('用户名和密码必须填写');
|
||||
return false;
|
||||
}
|
||||
if ($('#CaptchaCode').length && !$('#CaptchaCode').val()) {
|
||||
$('#errMsg').text('请填写验证码');
|
||||
return false;
|
||||
}
|
||||
$('#UserName').val(encode(userName));
|
||||
$('#Password').val(encode(password));
|
||||
return true;
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$('#form1').on('submit', onSubmit);
|
||||
});
|
||||
|
||||
window.history.replaceState(null, null, "/Account/Login?g=@(Guid.NewGuid())");
|
||||
|
||||
(function () {
|
||||
var btn = document.getElementById('ssoBtn');
|
||||
if (!btn) return;
|
||||
btn.addEventListener('click', function (e) {
|
||||
if (btn.classList.contains('loading')) { e.preventDefault(); return; }
|
||||
btn.classList.add('loading');
|
||||
var iconWrap = btn.querySelector('.sso-btn-icon');
|
||||
var textEl = btn.querySelector('.sso-btn-text');
|
||||
if (iconWrap) iconWrap.innerHTML = '<span class="sso-spinner"></span>';
|
||||
if (textEl) textEl.textContent = '跳转认证中...';
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@{
|
||||
@{
|
||||
ViewBag.Title = @GlobalConfig.ProjectTitle;
|
||||
Layout = "~/Views/Shared/_MainLayout.cshtml";
|
||||
}
|
||||
@@ -11,15 +11,8 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div>
|
||||
<div class="col-md-4" align="center" style="margin-top: 100px">
|
||||
<img src="/statics/images/logo_md_new.png" style="width:180px;height:160px;" />
|
||||
</div>
|
||||
<div class="col-md-4"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div>
|
||||
<div class="col-md-4" align="center" style="font-size: 30px; font-family: 微软雅黑; color: #8B2323;">
|
||||
<div>欢迎使用</div>
|
||||
<div class="col-md-4" align="center" style="margin-top: 100px; font-size: 30px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif; color: #8B2323;">
|
||||
<div>欢迎使用 <span style="font-weight: 800; letter-spacing: -0.04em; color: #C0221E;">OneDeriv</span></div>
|
||||
<div>@GlobalConfig.ProjectTitle</div>
|
||||
</div>
|
||||
<div class="col-md-4"></div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@inject Microsoft.Extensions.Configuration.IConfiguration Configuration
|
||||
@inject Microsoft.Extensions.Configuration.IConfiguration Configuration
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
@@ -233,8 +233,6 @@
|
||||
<img class="gtja-img" src="/Images/bh/main_title.png" />
|
||||
break;
|
||||
default:
|
||||
<!--基础页面,请考虑性能不要使用文件搜索方式-->
|
||||
<img src="/App_Docs/Images/main_title.png" />
|
||||
break;
|
||||
}
|
||||
<a href="/" class="gtja-title">
|
||||
@@ -304,9 +302,6 @@
|
||||
<div class="page-content" id="main-wrapper">
|
||||
@RenderBody()
|
||||
</div>
|
||||
<div class="page-footer">
|
||||
<p>Copyright © 2020 YieldChain</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -187,7 +187,8 @@
|
||||
<td>{{formatQuantity(floatPosition.Quantity)}}</td>
|
||||
<td>
|
||||
<vue-number-input v-model="floatPosition.TradingFee" v-bind:format="inputFormatInterestAmount" v-on:input="changeTradingFee"></vue-number-input>
|
||||
<div class="bubble-box" style="margin-left:6px;">我方{{floatPosition.PayDirection==1?"支付":"收取"}}交易费用</div>
|
||||
@* <div class="bubble-box" style="margin-left:6px;">我方{{floatPosition.PayDirection==1?"支付":"收取"}}交易费用</div> *@
|
||||
<div class="bubble-box" style="margin-left:6px;">我方收取交易费用</div>
|
||||
</td>
|
||||
<td> <vue-number-input v-model="floatPosition.DividendIn" v-bind:format="inputFormatDividend" v-on:input="changeTradingFee"></vue-number-input></td>
|
||||
<td style="font-size:18px;">{{formatAmount(floatPosition.FloatPnlSum)}}</td>
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
bool isShowReCheckClose = ViewBag.IsShowReCheckClose;
|
||||
bool hideFloatingIncomeDirection = PS.Config.ErpElement.SwapFloatingIncomeReceiveOnlyMode;
|
||||
}
|
||||
@section CSS{
|
||||
@section CSS {
|
||||
<link rel="stylesheet" href="~/Style/Css/unwindSwapTrade.css?v=@(HtmlUtil.JsVersion)" />
|
||||
}
|
||||
@section JS
|
||||
{
|
||||
{
|
||||
<script>
|
||||
var model = @Json.Serialize(Model);
|
||||
model.StartDate = model.StartDate ? model.StartDate.substr(0, 10) : "";
|
||||
@@ -88,7 +88,7 @@
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="formlabel">支付日期</label>
|
||||
<vue-datepicker :mindate="minStartDate" :holiday="1" v-model="deal.PayDate" />
|
||||
<vue-datepicker :mindate="minStartDate" :holiday="1" v-model="deal.PayDate" />
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="formlabel">是否罚息</label>
|
||||
@@ -231,10 +231,11 @@
|
||||
<td>{{formatQuantity(deal.CloseQty)}}</td>
|
||||
<td>
|
||||
<vue-number-input v-model="floatPosition.TradingFee" v-bind:format="inputFormatCloseAmount" v-on:input="changeTradingFee"></vue-number-input>
|
||||
<div class="bubble-box">我方{{floatPosition.PayDirection==1?"支付":"收取"}}交易费用</div>
|
||||
@* <div class="bubble-box">我方{{floatPosition.PayDirection==1?"支付":"收取"}}交易费用</div> *@
|
||||
<div class="bubble-box">我方收取交易费用</div>
|
||||
</td>
|
||||
<td>
|
||||
<vue-number-input v-model="floatPosition.TradingFeePending" v-bind:format="inputFormatEqvNotional" disabled></vue-number-input>
|
||||
<vue-number-input v-model="floatPosition.TradingFeePending" v-bind:format="inputFormatEqvNotional" disabled></vue-number-input>
|
||||
</td>
|
||||
<td>{{formatAmount(floatPosition.DividendIn)}}</td>
|
||||
<td style="font-size:18px;">{{formatAmount(floatPosition.FloatPnlSum)}}</td>
|
||||
|
||||
@@ -514,7 +514,8 @@
|
||||
</td>
|
||||
<td>
|
||||
<vue-number-input v-model="item.PosiTradingFeePending" v-bind:format="inputFormatTradeSinglePriceFixed2"></vue-number-input>
|
||||
<div class="bubble-box">我方{{item.PosiDirection==1?"支付":"收取"}}交易费用</div>
|
||||
@* <div class="bubble-box">我方{{item.PosiDirection==1?"支付":"收取"}}交易费用</div> *@
|
||||
<div class="bubble-box">我方收取交易费用</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M19.5 3L4.5 21H18L16.5 33L31.5 15H18L19.5 3Z" fill="#C0221E" stroke="#C0221E" stroke-width="2.1" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 258 B |
@@ -0,0 +1,3 @@
|
||||
<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9.20833 1.41666L2.125 9.91666H8.5L7.79167 15.5833L14.875 7.08333H8.5L9.20833 1.41666Z" stroke="white" stroke-width="1.55833" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 287 B |
@@ -0,0 +1,12 @@
|
||||
<svg width="50" height="50" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M34.1667 2.5H15.8333C8.46954 2.5 2.5 8.46954 2.5 15.8333V34.1667C2.5 41.5305 8.46954 47.5 15.8333 47.5H34.1667C41.5305 47.5 47.5 41.5305 47.5 34.1667V15.8333C47.5 8.46954 41.5305 2.5 34.1667 2.5Z" fill="url(#paint0_linear_4_83)"/>
|
||||
<path d="M33.9582 3.5415H16.0415C9.13794 3.5415 3.5415 9.13794 3.5415 16.0415V33.9582C3.5415 40.8617 9.13794 46.4582 16.0415 46.4582H33.9582C40.8617 46.4582 46.4582 40.8617 46.4582 33.9582V16.0415C46.4582 9.13794 40.8617 3.5415 33.9582 3.5415Z" stroke="white" stroke-opacity="0.14" stroke-width="1.25"/>
|
||||
<path d="M22.8398 13.084H22.834V36.917H22.8398V41.418H14.25C13.0077 41.418 12.0005 40.4102 12 39.168C12 37.9253 13.0074 36.918 14.25 36.918H18.334V15.835L13.9922 19.6846C13.0625 20.5083 11.6407 20.4223 10.8164 19.4932C9.99205 18.5633 10.078 17.1408 11.0078 16.3164L19.0908 9.15039C19.5024 8.78555 20.034 8.58301 20.584 8.58301H22.8398V13.084ZM26.834 8.58301C31.4997 8.58324 35.3927 10.0941 38.0918 13.1016C40.7585 16.0734 42 20.2182 42 25.001C41.9999 29.7836 40.7585 33.9278 38.0918 36.8994C35.3927 39.9069 31.4997 41.4168 26.834 41.417H25.8398V36.917H26.834C30.5005 36.9168 33.0666 35.7606 34.7422 33.8936C36.45 31.9905 37.4999 29.0508 37.5 25.001C37.5 20.9511 36.4499 18.0106 34.7422 16.1074C33.0666 14.2404 30.5004 13.0842 26.834 13.084H25.8398V8.58301H26.834Z" fill="white"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_4_83" x1="5.83333" y1="4.16667" x2="44.1667" y2="46.6667" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#E13A33"/>
|
||||
<stop offset="0.5" stop-color="#C9231F"/>
|
||||
<stop offset="1" stop-color="#961613"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -61,6 +61,16 @@
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id5">2.2 差分法</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#id6">3.新增希腊字母指标(利率敏感性指标)</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#delta-r">3.1 Delta_r</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#delta-r-1bp">3.2 Delta_r(1BP)</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#dv01">3.3 DV01</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#gamma-r">3.4 Gamma_r</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#gamma-r-1bp">3.5 Gamma_r(1BP)</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#vega-r">3.6 Vega_r</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#vega-r-1bp">3.7 Vega_r(1BP)</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="model.html">附录2:期权定价方法概述</a></li>
|
||||
@@ -221,8 +231,8 @@
|
||||
<tr class="row-even"><td><p>Delta</p></td>
|
||||
<td><p>设当前标的价格为 <span class="math notranslate nohighlight">\(S\)</span>,设 <span class="math notranslate nohighlight">\(S_\mathrm{u}=S+S_\mathrm{\bigtriangleup},S_\mathrm{d}=S-S_\mathrm{\bigtriangleup}\)</span></p>
|
||||
<p>将 <span class="math notranslate nohighlight">\(S_\mathrm{u}和S_\mathrm{d}\)</span> 代入定价公式, 得到期权价值 <span class="math notranslate nohighlight">\(V_\mathrm{u}和V_\mathrm{d}\)</span>; 则</p>
|
||||
<p><span class="math notranslate nohighlight">\(Delta=(V_\mathrm{u}-V_\mathrm{d})/(S*0.01)\)</span></p>
|
||||
<p>系统中 <span class="math notranslate nohighlight">\(S_\mathrm{\bigtriangleup}\)</span> 为 <span class="math notranslate nohighlight">\(0.005*S\)</span></p>
|
||||
<p><span class="math notranslate nohighlight">\(Delta=(V_\mathrm{u}-V_\mathrm{d})/(2\times S_\mathrm{\bigtriangleup})\)</span></p>
|
||||
<p>系统中 <span class="math notranslate nohighlight">\(S_\mathrm{\bigtriangleup}\)</span> 为 <span class="math notranslate nohighlight">\(0.0001\)</span>(绝对偏移,对应1bp)</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p>DeltaCash</p></td>
|
||||
@@ -232,7 +242,7 @@
|
||||
<td><p>设当前标的价格为 <span class="math notranslate nohighlight">\(S\)</span>, 期权理论价值为 <span class="math notranslate nohighlight">\(V\)</span>; 设 <span class="math notranslate nohighlight">\(S_\mathrm{u}=S+S_\mathrm{\bigtriangleup},S_\mathrm{d}=S-S_\mathrm{\bigtriangleup}\)</span></p>
|
||||
<p>将 <span class="math notranslate nohighlight">\(S_\mathrm{u}和S_\mathrm{d}\)</span> 代入定价公式,得到期权价值 <span class="math notranslate nohighlight">\(V_\mathrm{u}和V_\mathrm{d}\)</span>; 则</p>
|
||||
<p><span class="math notranslate nohighlight">\(Gamma=(V_\mathrm{u}+V_\mathrm{d}-2V)/S_\mathrm{\bigtriangleup}^2\)</span></p>
|
||||
<p>系统中 <span class="math notranslate nohighlight">\(S_\mathrm{\bigtriangleup}\)</span> 为 <span class="math notranslate nohighlight">\(0.01*S\)</span></p>
|
||||
<p>系统中 <span class="math notranslate nohighlight">\(S_\mathrm{\bigtriangleup}\)</span> 为 <span class="math notranslate nohighlight">\(0.0001\)</span>(绝对偏移,对应1bp)</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p>GammaCash</p></td>
|
||||
@@ -242,7 +252,7 @@
|
||||
<td><p>设当前波动率为𝜎, 设 <span class="math notranslate nohighlight">\(𝜎_\mathrm{u}=𝜎+𝜎_\mathrm{\bigtriangleup},𝜎_\mathrm{d}=𝜎-𝜎_\mathrm{\bigtriangleup}\)</span></p>
|
||||
<p>将 <span class="math notranslate nohighlight">\(𝜎_\mathrm{u}和𝜎_\mathrm{d}\)</span> 代入定价公式,得到期权价值 <span class="math notranslate nohighlight">\(V_\mathrm{u}和V_\mathrm{d}\)</span>; 则</p>
|
||||
<p><span class="math notranslate nohighlight">\(Vega=V_\mathrm{u}-V_\mathrm{d}\)</span></p>
|
||||
<p>系统中 <span class="math notranslate nohighlight">\(𝜎_\mathrm{\bigtriangleup}\)</span> 为 0.5%</p>
|
||||
<p>系统中 <span class="math notranslate nohighlight">\(𝜎_\mathrm{\bigtriangleup}\)</span> 为 0.0001(绝对偏移,对应1bp)</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p>Theta</p></td>
|
||||
@@ -255,21 +265,170 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p>Rho</p></td>
|
||||
<td><p>设无风险利率为 <span class="math notranslate nohighlight">\(r\)</span>,期权理论价值为 <span class="math notranslate nohighlight">\(V\)</span>; 设 <span class="math notranslate nohighlight">\(r_\mathrm{u}=r+10bp\)</span>;</p>
|
||||
<td><p>设无风险利率为 <span class="math notranslate nohighlight">\(r\)</span>, 期权理论价值为 <span class="math notranslate nohighlight">\(V\)</span>; 设 <span class="math notranslate nohighlight">\(r_\mathrm{u}=r+1bp\)</span>;</p>
|
||||
<p>将 <span class="math notranslate nohighlight">\(r_\mathrm{u}\)</span> 代入定价公式,得到期权价值 <span class="math notranslate nohighlight">\(V_\mathrm{u}\)</span>;则</p>
|
||||
<p><span class="math notranslate nohighlight">\(Rho=(V_\mathrm{u}-V)/10bp\)</span></p>
|
||||
<p><span class="math notranslate nohighlight">\(Rho = V_\mathrm{u} - V\)</span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p>亚式期权Delta</p></td>
|
||||
<td><p>设当前已观察到的标的平均价格为 <span class="math notranslate nohighlight">\(S_\mathrm{A}\)</span>, 设 <span class="math notranslate nohighlight">\(S_\mathrm{A_\mathrm{u}}=S_\mathrm{A}+S_\mathrm{A_\mathrm{\bigtriangleup}}\)</span></p>
|
||||
<p>将 <span class="math notranslate nohighlight">\(S_\mathrm{A_\mathrm{u}}\)</span> 代入定价公式,得到期权价值 <span class="math notranslate nohighlight">\(V_\mathrm{u}\)</span>; 则</p>
|
||||
<p><span class="math notranslate nohighlight">\(Delta=(V_\mathrm{u}-V)/S_\mathrm{A_\mathrm{\bigtriangleup}}\)</span></p>
|
||||
<p>系统中 <span class="math notranslate nohighlight">\(S_\mathrm{A_\mathrm{\bigtriangleup}}\)</span> 为 <span class="math notranslate nohighlight">\(0.01*S_\mathrm{A}\)</span></p>
|
||||
</td>
|
||||
<tr class="row-odd"><td><p>RhoQ</p></td>
|
||||
<td><p>计算逻辑同 Rho</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section id="id6">
|
||||
<span id="new-greeks"></span><h2>3.新增希腊字母指标(利率敏感性指标)<a class="headerlink" href="#id6" title="Permalink to this headline"></a></h2>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Note</p>
|
||||
<p>以下指标<strong>仅适用于</strong>利率收益率、利率债/信用债/其他债券、债券指数、国债期货四类资产。其他资产类别<strong>不计算</strong>这些指标,数值留空。</p>
|
||||
</div>
|
||||
<section id="delta-r">
|
||||
<h3>3.1 Delta_r — 期权对利率的敏感性<a class="headerlink" href="#delta-r" title="Permalink to this headline"></a></h3>
|
||||
<table class="docutils align-default">
|
||||
<colgroup>
|
||||
<col style="width: 20%" />
|
||||
<col style="width: 15%" />
|
||||
<col style="width: 65%" />
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr class="row-odd"><th class="head"><p>资产类型</p></th>
|
||||
<th class="head"><p>代表标的</p></th>
|
||||
<th class="head"><p>公式</p></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row-even"><td><p>利率收益率</p></td>
|
||||
<td><p>GB10</p></td>
|
||||
<td><p><span class="math notranslate nohighlight">\(Delta\_r = -Delta\)</span></p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p>利率债/信用债/其他债券</p></td>
|
||||
<td><p>210210.IB</p></td>
|
||||
<td><p><span class="math notranslate nohighlight">\(Delta\_r = Delta \times P \times D\)</span></p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p>债券指数</p></td>
|
||||
<td><p>CBA00621.CS</p></td>
|
||||
<td><p><span class="math notranslate nohighlight">\(Delta\_r = Delta \times P \times D\)</span></p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p>国债期货</p></td>
|
||||
<td><p>TS2609</p></td>
|
||||
<td><p><span class="math notranslate nohighlight">\(Delta\_r = Delta \times P \times D / CF\)</span></p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Note</p>
|
||||
<ul class="simple">
|
||||
<li><p><strong>P</strong>:债券/债券指数在计算日的全价/价格</p></li>
|
||||
<li><p><strong>D</strong>:债券/债券指数在计算日的修正久期(债券指数使用平均市值法久期)</p></li>
|
||||
<li><p><strong>CF</strong>:国债期货对应CTD债券的转换因子</p></li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
<section id="delta-r-1bp">
|
||||
<h3>3.2 Delta_r(1BP) — 利率变动1BP时Delta_r的变动<a class="headerlink" href="#delta-r-1bp" title="Permalink to this headline"></a></h3>
|
||||
<p>适用于全部四种资产类型:</p>
|
||||
<p><span class="math notranslate nohighlight">\(Delta\_r(1BP) = Delta\_r \times 0.0001\)</span></p>
|
||||
</section>
|
||||
<section id="dv01">
|
||||
<h3>3.3 DV01 — 利率变动1BP时期权价值变动(基点价值)<a class="headerlink" href="#dv01" title="Permalink to this headline"></a></h3>
|
||||
<p>适用于全部四种资产类型,与 Delta_r(1BP) 等价:</p>
|
||||
<p><span class="math notranslate nohighlight">\(DV01 = Delta\_r(1BP)\)</span></p>
|
||||
</section>
|
||||
<section id="gamma-r">
|
||||
<h3>3.4 Gamma_r — 期权对利率的二阶敏感性<a class="headerlink" href="#gamma-r" title="Permalink to this headline"></a></h3>
|
||||
<table class="docutils align-default">
|
||||
<colgroup>
|
||||
<col style="width: 20%" />
|
||||
<col style="width: 15%" />
|
||||
<col style="width: 65%" />
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr class="row-odd"><th class="head"><p>资产类型</p></th>
|
||||
<th class="head"><p>代表标的</p></th>
|
||||
<th class="head"><p>公式</p></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row-even"><td><p>利率收益率</p></td>
|
||||
<td><p>GB10</p></td>
|
||||
<td><p><span class="math notranslate nohighlight">\(Gamma\_r = Gamma\)</span></p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p>利率债/信用债/其他债券</p></td>
|
||||
<td><p>210210.IB</p></td>
|
||||
<td><p><span class="math notranslate nohighlight">\(Gamma\_r = Delta \times P \times C + (P \times D)^2 \times Gamma\)</span></p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p>债券指数</p></td>
|
||||
<td><p>CBA00621.CS</p></td>
|
||||
<td><p><span class="math notranslate nohighlight">\(Gamma\_r = Delta \times P \times C + (P \times D)^2 \times Gamma\)</span></p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p>国债期货</p></td>
|
||||
<td><p>TS2609</p></td>
|
||||
<td><p><span class="math notranslate nohighlight">\(Gamma\_r = Delta \times P \times C / CF + (P \times D / CF)^2 \times Gamma\)</span></p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Note</p>
|
||||
<ul class="simple">
|
||||
<li><p><strong>C</strong>:债券/债券指数的凸性(债券指数使用平均市值法凸性)</p></li>
|
||||
<li><p>P、D、CF 含义同 3.1 节</p></li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
<section id="gamma-r-1bp">
|
||||
<h3>3.5 Gamma_r(1BP) — 利率变动1BP时Gamma_r的变动<a class="headerlink" href="#gamma-r-1bp" title="Permalink to this headline"></a></h3>
|
||||
<p>适用于全部四种资产类型:</p>
|
||||
<p><span class="math notranslate nohighlight">\(Gamma\_r(1BP) = Gamma\_r \times 0.0001^2\)</span></p>
|
||||
</section>
|
||||
<section id="vega-r">
|
||||
<h3>3.6 Vega_r — 期权对利率波动率的敏感性<a class="headerlink" href="#vega-r" title="Permalink to this headline"></a></h3>
|
||||
<table class="docutils align-default">
|
||||
<colgroup>
|
||||
<col style="width: 20%" />
|
||||
<col style="width: 15%" />
|
||||
<col style="width: 65%" />
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr class="row-odd"><th class="head"><p>资产类型</p></th>
|
||||
<th class="head"><p>代表标的</p></th>
|
||||
<th class="head"><p>公式</p></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row-even"><td><p>利率收益率</p></td>
|
||||
<td><p>GB10</p></td>
|
||||
<td><p><span class="math notranslate nohighlight">\(Vega\_r = Vega\)</span></p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p>利率债/信用债/其他债券</p></td>
|
||||
<td><p>210210.IB</p></td>
|
||||
<td><p><span class="math notranslate nohighlight">\(Vega\_r = Vega \times D \times ytm\)</span></p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p>债券指数</p></td>
|
||||
<td><p>CBA00621.CS</p></td>
|
||||
<td><p><span class="math notranslate nohighlight">\(Vega\_r = Vega \times D \times ytm\)</span></p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p>国债期货</p></td>
|
||||
<td><p>TS2609</p></td>
|
||||
<td><p><span class="math notranslate nohighlight">\(Vega\_r = Vega \times D \times ytm\)</span>(D和ytm使用对应CTD券的值)</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Note</p>
|
||||
<ul class="simple">
|
||||
<li><p><strong>ytm</strong>:债券/债券指数在计算日的到期收益率(债券指数使用平均市值法到期收益率)</p></li>
|
||||
<li><p>D 含义同 3.1 节(修正久期)</p></li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
<section id="vega-r-1bp">
|
||||
<h3>3.7 Vega_r(1BP) — 利率波动率变动1BP时Vega_r的变动<a class="headerlink" href="#vega-r-1bp" title="Permalink to this headline"></a></h3>
|
||||
<p>适用于全部四种资产类型:</p>
|
||||
<p><span class="math notranslate nohighlight">\(Vega\_r(1BP) = Vega\_r \times 0.0001\)</span></p>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user