@@ -46,6 +46,7 @@
|
||||
let priceTick = null;
|
||||
let priceAutoScale = true;
|
||||
let rangeMarkers = [];
|
||||
let currentPriceLine = null;
|
||||
let lastCandles = [];
|
||||
let candleByTime = {};
|
||||
let chartMeta = null;
|
||||
@@ -159,9 +160,35 @@
|
||||
|
||||
function showLatestOhlcv() {
|
||||
paintOhlcv(latestCandle());
|
||||
updateCurrentPriceLine();
|
||||
updatePriceTag();
|
||||
}
|
||||
|
||||
function clearCurrentPriceLine() {
|
||||
if (currentPriceLine && candleSeries) {
|
||||
try {
|
||||
candleSeries.removePriceLine(currentPriceLine);
|
||||
} catch (e) {}
|
||||
}
|
||||
currentPriceLine = null;
|
||||
}
|
||||
|
||||
function updateCurrentPriceLine() {
|
||||
clearCurrentPriceLine();
|
||||
if (!candleSeries) return;
|
||||
const bar = latestCandle();
|
||||
if (!bar || bar.close == null) return;
|
||||
const up = Number(bar.close) >= Number(bar.open);
|
||||
currentPriceLine = candleSeries.createPriceLine({
|
||||
price: Number(bar.close),
|
||||
color: up ? "#00ff9d" : "#ff4d6d",
|
||||
lineWidth: 1,
|
||||
lineStyle: 2,
|
||||
axisLabelVisible: true,
|
||||
title: "现价",
|
||||
});
|
||||
}
|
||||
|
||||
function tickLiveClock() {
|
||||
const cd = fmtBarCountdown(barRemainMs(currentTf));
|
||||
if (elPriceTagTime && elPriceTag && !elPriceTag.classList.contains("hidden")) {
|
||||
|
||||
@@ -192,7 +192,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=20260528-hub-market6"></script>
|
||||
<script src="/assets/app.js?v=20260528-hub-market6"></script>
|
||||
<script src="/assets/chart.js?v=20260528-hub-market7"></script>
|
||||
<script src="/assets/app.js?v=20260528-hub-market7"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user