summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/template.html8
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> &nbsp; O ${fmt(c.Open)} &nbsp; H ${fmt(c.High)} &nbsp; L ${fmt(c.Low)} &nbsp; ` +
+ let t = `<b>${c.Date}</b> &nbsp; O ${fmt(c.Open)} &nbsp; H ${fmt(c.High)} &nbsp; L ${fmt(c.Low)} &nbsp; ` +
`C <b ${cc}>${fmt(c.Close)}</b> <span ${cc}>(${chg == null ? '–' : (chg >= 0 ? '+' : '') + chg.toFixed(2) + '%'})</span> &nbsp; ` +
`Vol ${fmtVol(c.Volume)} &nbsp; <span style="color:${css('--accent')}">RSI ${fmt(D.rsi[i], 1)}</span> &nbsp; ` +
`<span style="color:${css('--line1')}">K ${fmt(D.k[i], 1)}</span> &nbsp; <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 += ` &nbsp;|&nbsp; 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 += ` &nbsp;|&nbsp; 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;
}