feat(hub): show floating PnL on market page and drag stop-loss to place TP/SL

Pass unrealized PnL from monitor jump context, refresh from board snapshot, and let users drag the SL price line to call the same place-tpsl API as the monitor entrust dialog.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-04 19:31:45 +08:00
parent 93e148a3e7
commit e39fac2c16
5 changed files with 313 additions and 7 deletions
+2 -1
View File
@@ -163,6 +163,7 @@
<span class="ohlcv-item"><span class="k">止损</span><span id="mkt-pos-sl"></span></span>
<span class="ohlcv-item"><span class="k">止盈</span><span id="mkt-pos-tp"></span></span>
<span class="ohlcv-item"><span class="k">张数</span><span id="mkt-pos-size"></span></span>
<span class="ohlcv-item"><span class="k">浮盈亏</span><span id="mkt-pos-pnl" class="market-pos-pnl"></span></span>
<button type="button" id="market-pos-clear" class="ghost market-pos-clear" title="清除 K 线上的持仓价格线">清除标记</button>
</div>
<div id="market-pos-orders" class="market-pos-orders"></div>
@@ -248,7 +249,7 @@
<div id="toast"></div>
<script src="https://unpkg.com/lightweight-charts@4.2.0/dist/lightweight-charts.standalone.production.js"></script>
<script src="/assets/chart.js?v=20260604-hub-inst-theme"></script>
<script src="/assets/chart.js?v=20260604-market-pnl-sl-drag"></script>
<script src="/assets/app.js?v=20260604-hub-inst-theme"></script>
</body>
</html>