Use daily open as perp-hedge entry and toggle buy-straddle vs perp overlays.

Amp-stats now prices premium from each day's open, and the form switches mutually between straddle and perpetual-options对照.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-28 14:31:17 +08:00
parent d049c5d317
commit 2ce67da8e8
6 changed files with 191 additions and 97 deletions
+24 -17
View File
@@ -1265,34 +1265,37 @@
</select>
</label>
<label class="amp-field">
<span>对照模式</span>
<select id="amp-overlay-mode">
<option value="straddle" selected>买跨双边</option>
<option value="perp">永期对冲</option>
</select>
</label>
<label class="amp-field amp-overlay-straddle">
<span>买跨·双边权利金(点)</span>
<input id="amp-straddle-premium" type="number" min="0" step="any" placeholder="如 30" />
</label>
<label class="amp-field">
<label class="amp-field amp-overlay-straddle">
<span>止盈点(点)</span>
<input id="amp-take-profit" type="number" min="0" step="any" placeholder="空=按涨跌" />
</label>
<label class="amp-field">
<span>永期·现价</span>
<input id="amp-hedge-spot" type="number" min="0" step="any" placeholder="如 1800" />
</label>
<label class="amp-field">
<label class="amp-field amp-overlay-perp hidden">
<span>永期·目标盈利(U)</span>
<input id="amp-hedge-target" type="number" min="0" step="any" value="15" />
</label>
<label class="amp-field">
<label class="amp-field amp-overlay-perp hidden">
<span>永期·永续杠杆</span>
<input id="amp-hedge-perp-lev" type="number" min="0.01" step="any" value="10" />
</label>
<label class="amp-field">
<label class="amp-field amp-overlay-perp hidden">
<span>永期·期权杠杆</span>
<input id="amp-hedge-opt-lev" type="number" min="0.01" step="any" value="100" />
</label>
<label class="amp-field">
<label class="amp-field amp-overlay-perp hidden">
<span>永期·永续比例</span>
<input id="amp-hedge-ratio-perp" type="number" min="0.01" step="any" value="1" />
</label>
<label class="amp-field">
<label class="amp-field amp-overlay-perp hidden">
<span>永期·期权比例</span>
<input id="amp-hedge-ratio-opt" type="number" min="0.01" step="any" value="2" />
</label>
@@ -1303,24 +1306,28 @@
</div>
</div>
<p id="amp-status" class="toolbar-meta amp-status"></p>
<p class="amp-hint">口径:开→高=最高−开盘;开→低=开盘−最低;振幅=最高−最低.买跨收益=有效波动−权利金.永期对冲=永续多1币+买期权(默认1:2),对照所需点数达标与组合盈亏.周末按结算日标注/筛选.</p>
<p class="amp-hint">口径:开→高=最高−开盘;开→低=开盘−最低;振幅=最高−最低.对照模式二选一:买跨收益=有效波动−权利金;永期对冲=永续多1币+买期权(默认1:2),入场/权利金按日开盘.周末按结算日标注/筛选.</p>
<h3 class="amp-block-title">汇总</h3>
<div id="amp-summary" class="amp-summary"></div>
<h3 class="amp-block-title">买跨对照</h3>
<div id="amp-straddle" class="amp-summary amp-straddle"></div>
<h3 class="amp-block-title">永期对冲对照</h3>
<div id="amp-perp-hedge" class="amp-summary amp-perp-hedge"></div>
<div id="amp-overlay-straddle-block">
<h3 class="amp-block-title">买跨对照</h3>
<div id="amp-straddle" class="amp-summary amp-straddle"></div>
</div>
<div id="amp-overlay-perp-block" class="hidden">
<h3 class="amp-block-title">永期对冲对照</h3>
<div id="amp-perp-hedge" class="amp-summary amp-perp-hedge"></div>
</div>
<h3 class="amp-block-title">日表明细</h3>
<div class="amp-table-wrap">
<table class="amp-table">
<thead>
<tr>
<th>结算日</th><th>窗起点</th><th></th><th></th><th></th><th></th>
<th>开→高</th><th>开→低</th><th>振幅</th><th>涨跌</th><th>收益</th><th>永期盈亏</th>
<th>开→高</th><th>开→低</th><th>振幅</th><th>涨跌</th><th id="amp-col-pnl">收益</th>
</tr>
</thead>
<tbody id="amp-table-body">
<tr><td colspan="12" class="amp-empty">点击「计算」加载</td></tr>
<tr><td colspan="11" class="amp-empty">点击「计算」加载</td></tr>
</tbody>
</table>
</div>