s-ttp commited on
Commit
97bced9
·
verified ·
1 Parent(s): 2bd6bfe

Upload static/app.js with huggingface_hub

Browse files
Files changed (1) hide show
  1. static/app.js +5 -2
static/app.js CHANGED
@@ -566,9 +566,12 @@ function showResult(result) {
566
  if (br != null && bl != null && nu != null) {
567
  const ev = d.p_bear * br + d.p_neutral * nu + d.p_bull * bl;
568
  const sgn = x => (x >= 0 ? "+" : "") + x + "%";
 
 
 
 
569
  pm.querySelector(".bubble-body").insertAdjacentHTML("beforeend", `
570
- <p class="prob-ev">Expected value = bear ${pct(d.p_bear)}%·${sgn(br)} + neutral ${pct(d.p_neutral)}%·${sgn(nu)} + bull ${pct(d.p_bull)}%·${sgn(bl)} = <b>${ev >= 0 ? "+" : ""}${ev.toFixed(1)}%</b>
571
- <span class="prob-ev-note">The most-likely scenario isn't always the average: a likely-but-small move loses to a less-likely-but-large one. The headline verdict blends this debate with the quant/ML model.</span></p>`);
572
  }
573
  }
574
  }
 
566
  if (br != null && bl != null && nu != null) {
567
  const ev = d.p_bear * br + d.p_neutral * nu + d.p_bull * bl;
568
  const sgn = x => (x >= 0 ? "+" : "") + x + "%";
569
+ // Plain-English first; the arithmetic lives in the hover title for whoever wants it.
570
+ const evs = `${ev >= 0 ? "+" : ""}${ev.toFixed(1)}%`;
571
+ const formula = `bear ${pct(d.p_bear)}% × ${sgn(br)} + neutral ${pct(d.p_neutral)}% × ${sgn(nu)} + bull ${pct(d.p_bull)}% × ${sgn(bl)} = ${evs}`;
572
+ const big = Math.abs(br) >= Math.abs(bl) ? `the bear's ${sgn(br)}` : `the bull's ${sgn(bl)}`;
573
  pm.querySelector(".bubble-body").insertAdjacentHTML("beforeend", `
574
+ <p class="prob-ev" title="${formula}">Weighing each scenario by its odds nets out to <b>${evs}</b> — ${big} scenario pulls hardest on the average. <span class="prob-ev-note">Hover for the arithmetic. The headline verdict blends this with the quant model.</span></p>`);
 
575
  }
576
  }
577
  }