[object Object]

← back to Stock Vshape Viewer

Evidence-driven sweet-spot flag: mark scores in the backtest-validated 40-79 band (beat baseline at every horizon); warn on 80+ (rare + underperformed) — surfaces the counterintuitive finding at decision time

d1e5b8aefa5222be62807ebc1e8166b061132523 · 2026-08-28 00:22:48 -0700 · Steve

Files touched

Diff

commit d1e5b8aefa5222be62807ebc1e8166b061132523
Author: Steve <steve@designerwallcoverings.com>
Date:   Fri Aug 28 00:22:48 2026 -0700

    Evidence-driven sweet-spot flag: mark scores in the backtest-validated 40-79 band (beat baseline at every horizon); warn on 80+ (rare + underperformed) — surfaces the counterintuitive finding at decision time
---
 public/app.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/public/app.js b/public/app.js
index 2bd971f..db03753 100644
--- a/public/app.js
+++ b/public/app.js
@@ -320,9 +320,12 @@ function renderDetailBody(t, D) {
     <div class="kpi newhigh"><span>recent high</span><b>$${an.rh.price.toFixed(2)}</b>${an.rh.date.slice(5)}</div>
     <div class="kpi"><span>vs 50-DMA</span><b style="color:${an.d50>=0?'var(--pass)':'var(--fail)'}">${an.d50==null?'—':(an.d50>=0?'+':'')+an.d50.toFixed(1)+'%'}</b></div>
     <div class="kpi"><span>vs 200-DMA</span><b style="color:${an.d200>=0?'var(--pass)':'var(--fail)'}">${an.d200==null?'—':(an.d200>=0?'+':'')+an.d200.toFixed(1)+'%'}</b></div>`;
-  document.getElementById('d-scoreparts').innerHTML = (an.scoreParts && an.scoreParts.length)
+  const sweet = an.buyScore >= 40 && an.buyScore <= 79
+    ? ` <span class="sp pos" title="Backtest: the 40–79 band beat baseline at every horizon; 80+ underperformed. Higher isn't always better.">★ backtest sweet spot</span>`
+    : (an.buyScore >= 80 ? ` <span class="sp neg" title="Backtest: the 80+ band was rare and underperformed the 40–79 sweet spot.">⚠ above sweet spot</span>` : '');
+  document.getElementById('d-scoreparts').innerHTML = ((an.scoreParts && an.scoreParts.length)
     ? `<span>setup score ${an.buyScore} =</span>` + an.scoreParts.map(p => `<span class="sp ${p.v >= 0 ? 'pos' : 'neg'}">${p.k} ${p.v >= 0 ? '+' : ''}${p.v}</span>`).join('')
-    : '<span>setup score 0 — no qualifying components</span>';
+    : '<span>setup score 0 — no qualifying components</span>') + sweet;
   document.getElementById('d-vnote').textContent = D.custom
     ? `Custom range ${D.days[0].date} → ${D.days[D.days.length-1].date} (${D.days.length} sessions) — anchors, MAs, RSI & buy-score recomputed for this range.`
     : `Live daily prices. MAs over full history, sliced to the ${TF.find(x=>x.n===state.tfN)?.k||''} window.`;

← 5ca5574 CSV export: download scan matches (ticker/name/score/price/d  ·  back to Stock Vshape Viewer  ·  3D volume reads: per-vertex volume color (bright=heavy/dim=l 5ff5470 →