From 8c93a80302cee7ac73b9d4f2e90e47278164663f Mon Sep 17 00:00:00 2001 From: JSDurand Date: Mon, 12 Oct 2026 18:24:30 +0800 Subject: updates to the indicators and fix minor bugs --- web/template.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'web') diff --git a/web/template.html b/web/template.html index 5349e38..56bbea5 100644 --- a/web/template.html +++ b/web/template.html @@ -56,7 +56,7 @@ let hover = null, pins = []; let scheme = 'tw'; try { scheme = localStorage.getItem('scheme') || 'tw'; } catch (e) {} $('scheme').value = scheme; -$('title').textContent = `${D.name} · RSI(${D.rsiPeriod}) KD(${D.kdPeriod}) · ${D.candles[0].date} – ${D.candles[N-1].date}`; +$('title').textContent = `${D.name} · RSI(${D.rsiPeriod}) KD(${D.kdPeriod}) · ${D.candles[0].Date} – ${D.candles[N-1].Date}`; const css = n => getComputedStyle(document.documentElement).getPropertyValue(n).trim(); const fmt = (v, d = 2) => v == null ? '–' : v.toFixed(d); @@ -131,7 +131,7 @@ function render() { if (i % every) continue; const x = xOf(i); s += `` + - `${D.candles[i].date.slice(every > 30 ? 0 : 2)}`; + `${D.candles[i].Date.slice(every > 30 ? 0 : 2)}`; } // ---- candles + volume @@ -205,7 +205,7 @@ function updateInfo() { const prev = i > 0 ? D.candles[i-1].Close : null; const chg = prev ? (c.Close - prev) / prev * 100 : null; const cc = chg == null ? '' : `style="color:${chg >= 0 ? col.up : col.down}"`; - let t = `${c.date}   O ${fmt(c.Open)}   H ${fmt(c.High)}   L ${fmt(c.Low)}   ` + + let t = `${c.Date}   O ${fmt(c.Open)}   H ${fmt(c.High)}   L ${fmt(c.Low)}   ` + `C ${fmt(c.Close)} (${chg == null ? '–' : (chg >= 0 ? '+' : '') + chg.toFixed(2) + '%'})   ` + `Vol ${fmtVol(c.Volume)}   RSI ${fmt(D.rsi[i], 1)}   ` + `K ${fmt(D.k[i], 1)}   D ${fmt(D.d[i], 1)}`; @@ -213,7 +213,7 @@ function updateInfo() { const p = pins[pins.length - 1], pc = D.candles[p]; const diff = c.Close - pc.Close, pct = diff / pc.Close * 100; const days = Math.abs(i - p); - t += `  |  vs pin ${pc.date}: ${diff >= 0 ? '+' : ''}${diff.toFixed(2)} (${diff >= 0 ? '+' : ''}${pct.toFixed(2)}%), ${days} bars`; + t += `  |  vs pin ${pc.Date}: ${diff >= 0 ? '+' : ''}${diff.toFixed(2)} (${diff >= 0 ? '+' : ''}${pct.toFixed(2)}%), ${days} bars`; } $('info').innerHTML = t; } -- cgit v1.2.3-18-g5258