diff options
| author | JSDurand <mmemmew@gmail.com> | 2026-10-12 18:24:30 +0800 |
|---|---|---|
| committer | JSDurand <mmemmew@gmail.com> | 2026-10-12 18:24:30 +0800 |
| commit | 8c93a80302cee7ac73b9d4f2e90e47278164663f (patch) | |
| tree | f24f825b3751922b1d5023773afa71c353ac8e22 /web/template.html | |
| parent | 03d191a66ff66b6db80222f0f4dcde0b45c36d4e (diff) | |
updates to the indicators and fix minor bugs
Diffstat (limited to 'web/template.html')
| -rw-r--r-- | web/template.html | 8 |
1 files changed, 4 insertions, 4 deletions
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 += `<line class="grid" x1="${x}" x2="${x}" y1="${P.y}" y2="${K.y+K.h}"/>` + - `<text x="${x}" y="${K.y+K.h+14}" text-anchor="middle">${D.candles[i].date.slice(every > 30 ? 0 : 2)}</text>`; + `<text x="${x}" y="${K.y+K.h+14}" text-anchor="middle">${D.candles[i].Date.slice(every > 30 ? 0 : 2)}</text>`; } // ---- 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 = `<b>${c.date}</b> O ${fmt(c.Open)} H ${fmt(c.High)} L ${fmt(c.Low)} ` + + let t = `<b>${c.Date}</b> O ${fmt(c.Open)} H ${fmt(c.High)} L ${fmt(c.Low)} ` + `C <b ${cc}>${fmt(c.Close)}</b> <span ${cc}>(${chg == null ? '–' : (chg >= 0 ? '+' : '') + chg.toFixed(2) + '%'})</span> ` + `Vol ${fmtVol(c.Volume)} <span style="color:${css('--accent')}">RSI ${fmt(D.rsi[i], 1)}</span> ` + `<span style="color:${css('--line1')}">K ${fmt(D.k[i], 1)}</span> <span style="color:${css('--line2')}">D ${fmt(D.d[i], 1)}</span>`; @@ -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}: <b style="color:${diff >= 0 ? col.up : col.down}">${diff >= 0 ? '+' : ''}${diff.toFixed(2)} (${diff >= 0 ? '+' : ''}${pct.toFixed(2)}%)</b>, ${days} bars`; + t += ` | vs pin ${pc.Date}: <b style="color:${diff >= 0 ? col.up : col.down}">${diff >= 0 ? '+' : ''}${diff.toFixed(2)} (${diff >= 0 ? '+' : ''}${pct.toFixed(2)}%)</b>, ${days} bars`; } $('info').innerHTML = t; } |
