Add OKX options review module with hedge plan entries.
Import closed OKX option history and closed hedge plans into one list for journaling, images, and stats without mixing contract reviews. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
{# OKX 期权复盘(含对冲):独立页,不混合约 journal #}
|
||||
<div class="options-review-wrap" id="options-review-root" style="grid-column:1/-1">
|
||||
{% if not options_enabled %}
|
||||
<div class="flash" style="margin-bottom:12px">期权未启用:请设置 <code>OKX_OPTIONS_ENABLED=true</code> 后重启.对冲计划仍可单独同步(若本地有已结束计划).</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="card" style="margin-bottom:12px">
|
||||
<div class="form-row" style="flex-wrap:wrap;align-items:center;gap:8px">
|
||||
<h2 style="margin:0;margin-right:auto">期权复盘</h2>
|
||||
<button type="button" class="btn-secondary" id="or-sync-btn">从 OKX / 对冲计划同步</button>
|
||||
<span class="muted" id="or-sync-status"></span>
|
||||
</div>
|
||||
<p class="muted" style="margin:8px 0 0">同一列表三类:<strong>纯期权</strong>(交易所已平仓)、<strong>永期对冲</strong> / <strong>期期对冲</strong>(本地已结束计划,计划级一条).对冲盈亏用合计;归属对冲的期权腿默认不重复计入.</p>
|
||||
<style>
|
||||
.or-badge{display:inline-block;padding:2px 8px;border-radius:999px;background:rgba(127,127,127,.2);font-size:12px}
|
||||
.or-stat-card{border:1px solid rgba(127,127,127,.25);border-radius:8px;padding:10px}
|
||||
#or-edit-modal{align-items:center;justify-content:center;background:rgba(0,0,0,.55)}
|
||||
</style>
|
||||
<div class="form-row" style="flex-wrap:wrap;gap:8px;margin-top:10px">
|
||||
<select id="or-filter-source">
|
||||
<option value="">类型:全部</option>
|
||||
<option value="option_spot">纯期权</option>
|
||||
<option value="perp_options">永期对冲</option>
|
||||
<option value="options_options">期期对冲</option>
|
||||
</select>
|
||||
<select id="or-filter-uly">
|
||||
<option value="">标的:全部</option>
|
||||
<option value="ETH">ETH</option>
|
||||
<option value="BTC">BTC</option>
|
||||
</select>
|
||||
<select id="or-filter-opt">
|
||||
<option value="">Call/Put:全部</option>
|
||||
<option value="C">Call</option>
|
||||
<option value="P">Put</option>
|
||||
</select>
|
||||
<select id="or-filter-reviewed">
|
||||
<option value="">复盘:全部</option>
|
||||
<option value="0">待复盘</option>
|
||||
<option value="1">已复盘</option>
|
||||
</select>
|
||||
<input type="text" id="or-filter-strategy" placeholder="策略标签" style="max-width:120px">
|
||||
<input type="datetime-local" id="or-filter-from" title="平仓起">
|
||||
<input type="datetime-local" id="or-filter-to" title="平仓止">
|
||||
<label class="muted" style="display:flex;align-items:center;gap:4px">
|
||||
<input type="checkbox" id="or-include-hedge-legs"> 含已归属对冲的期权腿
|
||||
</label>
|
||||
<button type="button" class="btn-secondary" id="or-reload-btn">刷新</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card" style="margin-bottom:12px">
|
||||
<h3 style="margin-top:0">统计</h3>
|
||||
<div id="or-kpi" class="form-row" style="flex-wrap:wrap;gap:12px"></div>
|
||||
<div id="or-stats-groups" style="margin-top:12px;display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px"></div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h3 style="margin-top:0">交易列表</h3>
|
||||
<div class="options-strike-table-wrap">
|
||||
<table class="options-strike-table" id="or-trades-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>类型</th>
|
||||
<th>标的/合约</th>
|
||||
<th>盈亏</th>
|
||||
<th>开/平</th>
|
||||
<th>持有</th>
|
||||
<th>策略</th>
|
||||
<th>状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="or-trades-tbody">
|
||||
<tr><td colspan="8" class="muted">加载中…</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-modal" id="or-edit-modal" style="display:none" onclick="OptionsReview.closeModal(event)">
|
||||
<div class="panel" style="max-width:720px;width:94%" onclick="event.stopPropagation()">
|
||||
<div class="panel-head">
|
||||
<div class="panel-title" id="or-edit-title">复盘编辑</div>
|
||||
<button type="button" class="panel-close" onclick="OptionsReview.closeModal()">关闭</button>
|
||||
</div>
|
||||
<div class="panel-body" id="or-edit-body"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/static/options_review.js?v=1"></script>
|
||||
Reference in New Issue
Block a user