<!DOCTYPE html>
<html lang="en" data-theme="light">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Stock Screener</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans+Condensed:wght@400;600;700&display=swap" rel="stylesheet">
<style>
:root{
color-scheme:light;
--paper:#FFFFFF; --panel:#F5F6F8; --panel2:#EAEDF1; --deep:#E1E5EA;
--ink:#12181D; --ink2:#46525C; --muted:#5B666F; --rule:#DEE2E7; --rule2:#C0C7CE;
--up:#0B7A52; --down:#C2382C; --link:#1A5FA8; --flag:#8F5E0F;
--accent:#12181D; --onaccent:#FFFFFF; --subj:#1A5FA8;
--thbg:#12181D; --thfg:#FFFFFF; --thbg2:#2A343C; --subjbg:#E7EFF8; --subjbg2:#D9E5F3;
--sans:'IBM Plex Sans Condensed',ui-sans-serif,'Helvetica Neue',Arial,sans-serif;
--mono:'IBM Plex Mono',ui-monospace,'SFMono-Regular',Menlo,Consolas,monospace;
}
:root[data-theme="dark"]{
color-scheme:dark;
--paper:#0D1317; --panel:#141C22; --panel2:#1B252C; --deep:#232F38;
--ink:#DCE4EA; --ink2:#9CADB9; --muted:#80909E; --rule:#25323B; --rule2:#384954;
--up:#37B47E; --down:#E8655B; --link:#6BB5E8; --flag:#D9A15C;
--accent:#D9A15C; --onaccent:#0D1317; --subj:#6BB5E8;
--thbg:#232F38; --thfg:#DCE4EA; --thbg2:#2E3D48; --subjbg:#16293A; --subjbg2:#1D3345;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
::selection{background:var(--link);color:var(--paper)}
body{background:var(--paper);color:var(--ink);font-family:var(--sans);font-size:15px;line-height:1.45;-webkit-font-smoothing:antialiased}
.lbl{font-family:var(--mono);font-size:9.5px;letter-spacing:.16em;text-transform:uppercase;color:var(--muted)}
.mono{font-family:var(--mono);font-variant-numeric:tabular-nums}
.up{color:var(--up)} .down{color:var(--down)}
button,select,input{font-family:inherit;font-size:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:2px solid var(--link);outline-offset:2px}
.hidden{display:none!important}
a{color:var(--link)}
header{border-bottom:1px solid var(--rule2);padding:12px 18px 9px;display:flex;flex-wrap:wrap;gap:14px;align-items:flex-end}
.wordmark{display:flex;align-items:baseline;gap:9px}
h1{margin:0;font-size:32px;font-weight:700;letter-spacing:-.035em;line-height:.9;text-transform:uppercase}
.seq{font-family:var(--mono);font-size:11px;letter-spacing:.14em;border:1px solid var(--rule2);padding:2px 6px;text-transform:uppercase}
.mast-r{margin-left:auto;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.btn{background:transparent;border:1px solid var(--rule2);padding:5px 11px;font-size:12px;font-weight:600;letter-spacing:.02em;border-radius:0;transition:background .12s,color .12s}
.btn:hover:not(:disabled){background:var(--accent);border-color:var(--accent);color:var(--onaccent)}
.btn.on{background:var(--accent);border-color:var(--accent);color:var(--onaccent)}
.btn.sm{padding:3px 8px;font-size:11px}
.btn:disabled{opacity:.4;cursor:not-allowed}
.btn.danger{border-color:var(--down);color:var(--down)}
.btn.danger:hover{background:var(--down);color:var(--paper)}
nav{display:flex;align-items:center;gap:2px;padding:0 18px;border-bottom:1px solid var(--rule);flex-wrap:wrap;background:var(--panel)}
.tab{background:none;border:0;border-bottom:3px solid transparent;padding:9px 14px 7px;font-size:13px;font-weight:600;letter-spacing:.03em;text-transform:uppercase;color:var(--muted)}
.tab.on{color:var(--ink);border-bottom-color:var(--ink)}
.tab:hover{color:var(--ink)}
.nav-r{margin-left:auto;display:flex;gap:12px;align-items:center;padding:5px 0}
.buildbar{padding:11px 18px;border-bottom:1px solid var(--rule);display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap;background:var(--panel)}
#subj{font-family:var(--mono);font-size:17px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;width:122px;padding:5px 8px;border:1px solid var(--rule2);background:var(--paper)}
select,input[type=text],input[type=number],input[type=password]{background:var(--paper);border:1px solid var(--rule);padding:4px 7px;font-size:12.5px;border-radius:0}
input::placeholder{color:var(--muted)}
.field{display:flex;flex-direction:column;gap:3px}
.bar{height:3px;background:var(--panel2);border:1px solid var(--rule);overflow:hidden;min-width:150px;flex:1;max-width:300px}
.bar i{display:block;height:100%;background:var(--link);width:0;transition:width .25s}
main{padding:16px 18px 0}
section.blk{margin-bottom:22px}
.blkhead{display:flex;align-items:baseline;gap:10px;border-bottom:1px solid var(--rule2);padding-bottom:3px;margin-bottom:10px;flex-wrap:wrap}
.blkhead h2{margin:0;font-size:14px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
.blkhead .note{margin-left:auto;font-family:var(--mono);font-size:10px;color:var(--muted);letter-spacing:.06em}
/* comp table */
.tblwrap{border:1px solid var(--rule2);overflow:auto;background:var(--paper);max-height:70vh}
table{border-collapse:separate;border-spacing:0;width:100%;font-size:12.5px}
th{position:sticky;top:0;z-index:3;background:var(--thbg);color:var(--thfg);text-align:left;padding:5px 7px;
font-size:9.5px;letter-spacing:.1em;text-transform:uppercase;font-weight:600;white-space:nowrap;
font-family:var(--mono);cursor:pointer;border-bottom:1px solid var(--rule2)}
th:hover{background:var(--thbg2)}
th.num,td.num{text-align:right}
th .ar{opacity:.5;margin-left:2px}
td{padding:3px 7px;border-bottom:1px solid var(--rule);white-space:nowrap}
tbody tr:hover{background:var(--panel2)}
td.num{font-family:var(--mono);font-variant-numeric:tabular-nums}
td.tkr{font-family:var(--mono);font-weight:600;letter-spacing:.03em}
td.dim{color:var(--muted);font-size:11.5px}
tr.subject td{background:var(--subjbg);font-weight:600;border-bottom:1px solid var(--subj)}
tr.subject:hover td{background:var(--subjbg2)}
tr.subject td.tkr{color:var(--subj)}
tr.off td{opacity:.38;font-style:italic}
tfoot td{background:var(--panel2);font-weight:600;border-top:1px solid var(--rule2);position:sticky;bottom:0;z-index:2}
th.stick,td.stick{position:sticky;left:0;z-index:2;background:var(--paper)}
th.stick{z-index:4;background:var(--thbg)}
tr.subject td.stick{background:var(--subjbg)}
tfoot td.stick{background:var(--panel2)}
tbody tr:hover td.stick{background:var(--panel2)}
.cbx{width:13px;height:13px;vertical-align:-2px;cursor:pointer;accent-color:var(--accent)}
/* distribution strips */
.dist{display:flex;flex-direction:column;border:1px solid var(--rule2)}
.drow{display:grid;grid-template-columns:120px 1fr 96px;gap:12px;align-items:center;padding:7px 11px;border-bottom:1px solid var(--rule)}
.drow:last-child{border-bottom:0}
.drow:nth-child(even){background:var(--panel)}
.dname{font-size:12.5px}
.dname small{display:block;font-family:var(--mono);font-size:9.5px;color:var(--muted);letter-spacing:.08em}
.strip{position:relative;height:26px}
.axis{position:absolute;left:0;right:0;top:13px;height:1px;background:var(--rule2)}
.box{position:absolute;top:6px;height:15px;background:var(--deep);border:1px solid var(--muted)}
.med{position:absolute;top:4px;width:2px;height:19px;background:var(--ink)}
.pt{position:absolute;top:9px;width:1.5px;height:9px;background:var(--ink2);opacity:.5}
.me{position:absolute;top:1px;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;
border-top:7px solid var(--subj);margin-left:-5px}
.me::after{content:attr(data-v);position:absolute;top:-13px;left:50%;transform:translateX(-50%);
font-family:var(--mono);font-size:9px;color:var(--subj);white-space:nowrap;font-weight:600}
.dends{position:absolute;left:0;right:0;top:22px;display:flex;justify-content:space-between;
font-family:var(--mono);font-size:8.5px;color:var(--muted)}
.dpct{font-family:var(--mono);font-size:11px;text-align:right}
.dpct b{display:block;font-size:15px;font-weight:600}
.empty{border:1px dashed var(--muted);padding:26px;text-align:center;color:var(--ink2);background:var(--panel)}
.empty h3{margin:0 0 6px;font-size:17px;font-weight:700;color:var(--ink)}
.empty p{margin:0 auto 13px;max-width:58ch;font-size:13px}
.chips{display:flex;gap:5px;flex-wrap:wrap;margin-bottom:9px}
.chip{border:1px solid var(--rule);background:var(--panel);padding:2px 7px;font-family:var(--mono);font-size:11px;display:flex;gap:5px;align-items:center}
.chip x{font-style:normal;opacity:.5;cursor:pointer}
.chip x:hover{opacity:1;color:var(--down)}
#keys{border:1px solid var(--rule2);background:var(--panel);padding:14px 16px;margin:14px 18px 0;display:none}
#keys.open{display:block}
#keys h3{margin:0 0 3px;font-size:15px}
#keys p{margin:0 0 11px;font-size:12.5px;color:var(--ink2);max-width:76ch}
.krow{display:flex;gap:12px;flex-wrap:wrap;align-items:flex-end}
.krow .field{flex:1;min-width:186px} .krow input{width:100%}
.warn{margin-top:11px;font-size:11.5px;color:var(--ink2);border-left:2px solid var(--down);padding-left:9px;max-width:80ch}
.remember{display:flex;gap:6px;align-items:center;font-size:12.5px;margin-top:9px}
footer{margin-top:26px;border-top:1px solid var(--rule2);padding:13px 18px 32px;display:flex;gap:26px;flex-wrap:wrap}
.quota{font-family:var(--mono);font-size:10.5px;color:var(--ink2);line-height:1.6}
.quota b{color:var(--ink);font-weight:600}
.src{font-size:11.5px;color:var(--ink2);max-width:44ch;line-height:1.5}
.bgauge{height:14px;border:1px solid var(--rule2);display:flex;margin:5px 0 4px;background:var(--paper);width:250px}
.bgauge i{display:block;height:100%}
@media(max-width:700px){
h1{font-size:23px} header,nav,main,footer,.buildbar{padding-left:12px;padding-right:12px}
#keys{margin-left:12px;margin-right:12px}
.drow{grid-template-columns:88px 1fr 62px;gap:8px}
}
</style>
</head>
<body>
<header>
<div class="wordmark"><h1>Stock Screener</h1></div>
<div class="mast-r">
<span class="lbl" id="clock"></span>
<button class="btn sm" id="themebtn">Dark</button>
<button class="btn" id="keybtn">API keys</button>
</div>
</header>
<div id="keys">
<h3>Bring your own key</h3>
<p>A comparison set costs roughly three calls per company on Finnhub, or one per company on Alpha Vantage. Keys go straight to the provider.</p>
<div class="krow">
<label class="field"><span class="lbl">Finnhub — 60/min · best for comp sets</span><input type="password" id="k_fh" placeholder="paste key" autocomplete="off"></label>
<label class="field"><span class="lbl">Alpha Vantage — 25/day · richer multiples, tighter cap</span><input type="password" id="k_av" placeholder="paste key" autocomplete="off"></label>
<button class="btn" id="ksave">Save keys</button>
</div>
<label class="remember"><input type="checkbox" id="k_remember" class="cbx" checked> Remember keys on this device</label>
<div class="warn">Unchecked, keys live in memory for this session only and are never written to storage. Either way a key is visible to anyone with this browser profile, to browser extensions, and to a TLS-inspecting proxy on a managed network — the providers require it in the request URL.</div>
</div>
<nav>
<button class="tab on" data-tab="cmp">Comparables</button>
<button class="tab" data-tab="dst">Distribution</button>
<button class="tab" data-tab="uni">Find candidates</button>
<div class="nav-r"><span class="lbl" id="status">Ready</span></div>
</nav>
<div class="buildbar">
<label class="field"><span class="lbl">Subject</span>
<input id="subj" list="unilist" value="NVDA" placeholder="TICKER" autocomplete="off" spellcheck="false"></label>
<datalist id="unilist"></datalist>
<label class="field"><span class="lbl">Peer set</span>
<select id="pmode">
<option value="sub">Same GICS sub-industry — no API cost</option>
<option value="sec">Same GICS sector — no API cost</option>
<option value="api">Provider peer list — 1 call</option>
<option value="man">My own list</option>
</select></label>
<label class="field" id="manwrap" style="display:none"><span class="lbl">Tickers, comma separated</span>
<input type="text" id="manlist" style="width:230px" placeholder="AMD, INTC, AVGO"></label>
<label class="field"><span class="lbl">Max peers</span>
<select id="pcap"><option>6</option><option selected>12</option><option>20</option><option>30</option></select></label>
<button class="btn" id="build">Build comp set</button>
<div class="bar"><i id="pbar"></i></div>
<span class="lbl" id="provline"></span>
</div>
<main>
<!-- ============ COMPARABLES ============ -->
<div id="tab-cmp">
<section class="blk">
<div class="blkhead"><h2>Comparison set</h2>
<span class="note" id="cmpnote"></span></div>
<div class="chips" id="chips"></div>
<div style="display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:9px">
<input type="text" id="addt" placeholder="add ticker" style="width:110px;font-family:var(--mono);text-transform:uppercase">
<button class="btn sm" id="addbtn">Add to set</button>
<button class="btn sm" id="loadmiss">Load missing metrics</button>
<div style="flex:1"></div>
<button class="btn sm" id="exp">Export comp set</button>
</div>
<div class="tblwrap" id="cmpwrap"></div>
<p class="lbl" id="cmpfoot" style="margin:8px 0 0"></p>
</section>
</div>
<!-- ============ DISTRIBUTION ============ -->
<div id="tab-dst" class="hidden">
<section class="blk">
<div class="blkhead"><h2>Where the subject sits</h2>
<span class="note">box = interquartile range · heavy line = peer median · ticks = individual peers</span></div>
<div class="dist" id="dist"></div>
</section>
</div>
<!-- ============ UNIVERSE ============ -->
<div id="tab-uni" class="hidden">
<section class="blk">
<div class="blkhead"><h2>Find candidates</h2>
<span class="note">503 companies filter instantly · numeric filters apply only to rows you have loaded</span></div>
<div style="display:flex;gap:9px;flex-wrap:wrap;align-items:flex-end;margin-bottom:10px">
<label class="field"><span class="lbl">Search</span><input type="text" id="u_q" style="width:140px" placeholder="ticker or name"></label>
<label class="field"><span class="lbl">Sector</span><select id="u_sec" style="max-width:170px"></select></label>
<label class="field"><span class="lbl">Sub-industry</span><select id="u_sub" style="max-width:190px"></select></label>
<label class="field"><span class="lbl">Metric</span><select id="u_met"></select></label>
<label class="field"><span class="lbl">Min</span><input type="number" id="u_min" style="width:78px" placeholder="—"></label>
<label class="field"><span class="lbl">Max</span><input type="number" id="u_max" style="width:78px" placeholder="—"></label>
<button class="btn sm" id="u_reset">Reset</button>
<button class="btn sm" id="u_addall">Add visible to comp set</button>
</div>
<div class="tblwrap" id="uniwrap" style="max-height:60vh"></div>
<p class="lbl" id="unifoot" style="margin:8px 0 0"></p>
</section>
</div>
</main>
<footer>
<div>
<div class="lbl">Page weight against the 1 MB budget</div>
<div class="bgauge" id="gauge"></div>
<div class="lbl" id="gkey"></div>
</div>
<div class="quota" id="quota"></div>
<p class="src"><span class="lbl">Sources</span><br>
Universe and peer grouping: 503 S&P 500 constituents with GICS sector and sub-industry, baked in at build time from the open
<a href="https://github.com/datasets/s-and-p-500-companies" target="_blank" rel="noopener">datasets/s-and-p-500-companies</a> snapshot.
Metrics: <a href="https://finnhub.io" target="_blank" rel="noopener">Finnhub</a> and
<a href="https://www.alphavantage.co" target="_blank" rel="noopener">Alpha Vantage</a>, as reported and not audited here.
Medians exclude non-positive multiples. Not investment advice.</p>
</footer>
<script>
"use strict";
const BLOB = {"sec":["Communication Services","Consumer Discretionary","Consumer Staples","Energy","Financials","Health Care","Industrials","Information Technology","Materials","Real Estate","Utilities"],"sub":["Advertising","Aerospace & Defense","Agricultural & Farm Machinery","Agricultural Products & Services","Air Freight & Logistics","Apparel Retail","Apparel, Accessories & Luxury Goods","Application Software","Asset Management & Custody Banks","Automobile Manufacturers","Automotive Parts & Equipment","Automotive Retail","Biotechnology","Brewers","Broadcasting","Broadline Retail","Building Products","Cable & Satellite","Cargo Ground Transportation","Casinos & Gaming","Commodity Chemicals","Communications Equipment","Computer & Electronics Retail","Construction & Engineering","Construction Machinery & Heavy Transportation Equipment","Construction Materials","Consumer Electronics","Consumer Finance","Consumer Staples Merchandise Retail","Copper","Data Center REITs","Data Processing & Outsourced Services","Distillers & Vintners","Distributors","Diversified Banks","Diversified Support Services","Electric Utilities","Electrical Components & Equipment","Electronic Components","Electronic Equipment & Instruments","Electronic Manufacturing Services","Environmental & Facilities Services","Fertilizers & Agricultural Chemicals","Financial Exchanges & Data","Food Distributors","Food Retail","Footwear","Gas Utilities","Gold","Health Care Distributors","Health Care Equipment","Health Care Facilities","Health Care REITs","Health Care Services","Health Care Supplies","Health Care Technology","Heavy Electrical Equipment","Home Improvement Retail","Homebuilding","Homefurnishing Retail","Hotel & Resort REITs","Hotels, Resorts & Cruise Lines","Household Products","Human Resource & Employment Services","IT Consulting & Other Services","Independent Power Producers & Energy Traders","Industrial Conglomerates","Industrial Gases","Industrial Machinery & Supplies & Components","Industrial REITs","Insurance Brokers","Integrated Oil & Gas","Integrated Telecommunication Services","Interactive Home Entertainment","Interactive Media & Services","Internet Services & Infrastructure","Investment Banking & Brokerage","Leisure Products","Life & Health Insurance","Life Sciences Tools & Services","Managed Health Care","Metal, Glass & Plastic Containers","Movies & Entertainment","Multi-Family Residential REITs","Multi-Sector Holdings","Multi-Utilities","Multi-line Insurance","Office REITs","Oil & Gas Equipment & Services","Oil & Gas Exploration & Production","Oil & Gas Refining & Marketing","Oil & Gas Storage & Transportation","Other Specialized REITs","Other Specialty Retail","Packaged Foods & Meats","Paper & Plastic Packaging Products & Materials","Passenger Airlines","Passenger Ground Transportation","Personal Care Products","Pharmaceuticals","Property & Casualty Insurance","Publishing","Rail Transportation","Real Estate Services","Regional Banks","Reinsurance","Research & Consulting Services","Restaurants","Retail REITs","Self-Storage REITs","Semiconductor Materials & Equipment","Semiconductors","Single-Family Residential REITs","Soft Drinks & Non-alcoholic Beverages","Specialized Consumer Services","Specialty Chemicals","Steel","Systems Software","Technology Distributors","Technology Hardware, Storage & Peripherals","Telecom Tower REITs","Timber REITs","Tobacco","Trading Companies & Distributors","Transaction & Payment Processing Services","Water Utilities","Wireless Telecommunication Services"],"t":"A,AAPL,ABBV,ABNB,ABT,ACGL,ACN,ADBE,ADI,ADM,ADP,ADSK,AEE,AEP,AES,AFL,AIG,AIZ,AJG,AKAM,ALB,ALGN,ALL,ALLE,AMAT,AMCR,AMD,AME,AMGN,AMP,AMT,AMZN,ANET,AON,AOS,APA,APD,APH,APO,APP,APTV,ARE,ARES,ATO,AVB,AVGO,AVY,AWK,AXON,AXP,AZO,BA,BAC,BALL,BAX,BBY,BDX,BEN,BF.B,BG,BIIB,BKNG,BKR,BLDR,BLK,BMY,BNY,BR,BRK.B,BRO,BSX,BX,BXP,C,CAH,CARR,CASY,CAT,CB,CBOE,CBRE,CCI,CCL,CDNS,CDW,CEG,CF,CFG,CHD,CHRW,CHTR,CI,CIEN,CINF,CL,CLX,CMCSA,CME,CMG,CMI,CMS,CNC,CNP,COF,COHR,COIN,COO,COP,COR,COST,CPAY,CPRT,CPT,CRH,CRL,CRM,CRWD,CSCO,CSGP,CSX,CTAS,CTSH,CTVA,CVNA,CVS,CVX,D,DAL,DASH,DD,DDOG,DE,DECK,DELL,DG,DGX,DHI,DHR,DIS,DLR,DLTR,DOC,DOV,DOW,DPZ,DRI,DTE,DUK,DVA,DVN,DXCM,EA,EBAY,ECHO,ECL,ED,EFX,EG,EIX,EL,ELV,EME,EMR,EOG,EQIX,EQR,EQT,ERIE,ES,ESS,ETN,ETR,EVRG,EW,EXC,EXE,EXPD,EXPE,EXR,F,FANG,FAST,FCX,FDS,FDX,FDXF,FE,FFIV,FICO,FIS,FISV,FITB,FIX,FLEX,FOX,FOXA,FRT,FSLR,FTNT,FTV,GD,GDDY,GE,GEHC,GEN,GEV,GILD,GIS,GL,GLW,GM,GNRC,GOOG,GOOGL,GPC,GPN,GRMN,GS,GWW,HAL,HAS,HBAN,HCA,HD,HIG,HII,HLT,HON,HONA,HOOD,HPE,HPQ,HRL,HSIC,HST,HSY,HUBB,HUM,HWM,IBKR,IBM,ICE,IDXX,IEX,IFF,INCY,INTC,INTU,INVH,IP,IQV,IR,IRM,ISRG,IT,ITW,IVZ,J,JBHT,JBL,JCI,JKHY,JNJ,JPM,KDP,KEY,KEYS,KHC,KIM,KKR,KLAC,KMB,KMI,KO,KR,KVUE,L,LDOS,LEN,LH,LHX,LII,LIN,LITE,LLY,LMT,LNT,LOW,LRCX,LULU,LUV,LVS,LYB,LYV,MA,MAA,MAR,MAS,MCD,MCHP,MCK,MCO,MDLZ,MDT,MET,META,MGM,MKC,MLM,MMM,MNST,MO,MOS,MPC,MPWR,MRK,MRNA,MRSH,MRVL,MS,MSCI,MSFT,MSI,MTB,MTD,MU,NCLH,NDAQ,NDSN,NEE,NEM,NFLX,NI,NKE,NOC,NOW,NRG,NSC,NTAP,NTRS,NUE,NVDA,NVR,NWS,NWSA,NXPI,O,ODFL,OKE,OMC,ON,ORCL,ORLY,OTIS,OXY,PANW,PAYX,PCAR,PCG,PEG,PEP,PFE,PFG,PG,PGR,PH,PHM,PKG,PLD,PLTR,PM,PNC,PNR,PNW,PODD,PPG,PPL,PRU,PSA,PSKY,PSX,PTC,PWR,PYPL,Q,QCOM,RCL,REG,REGN,RF,RJF,RL,RMD,ROK,ROL,ROP,ROST,RSG,RTX,RVTY,SBAC,SBUX,SCHW,SHW,SJM,SLB,SMCI,SNA,SNDK,SNPS,SO,SOLV,SPG,SPGI,SRE,STE,STLD,STT,STX,STZ,SW,SWK,SWKS,SYF,SYK,SYY,T,TAP,TDG,TDY,TECH,TEL,TER,TFC,TGT,TJX,TKO,TMO,TMUS,TPL,TPR,TRGP,TRMB,TROW,TRV,TSCO,TSLA,TSN,TT,TTD,TTWO,TXN,TXT,TYL,UAL,UBER,UDR,UHS,ULTA,UNH,UNP,UPS,URI,USB,V,VEEV,VICI,VLO,VLTO,VMC,VRSK,VRSN,VRT,VRTX,VST,VTR,VTRS,VZ,WAB,WAT,WBD,WDAY,WDC,WEC,WELL,WFC,WM,WMB,WMT,WRB,WSM,WST,WTW,WY,WYNN,XEL,XOM,XYL,XYZ,YUM,ZBH,ZBRA,ZTS","n":"Agilent Technologies|Apple Inc.|AbbVie|Airbnb|Abbott Laboratories|Arch Capital Group|Accenture|Adobe Inc.|Analog Devices|Archer Daniels Midland|Automatic Data Processing|Autodesk|Ameren|American Electric Power|AES Corporation|Aflac|American International Group|Assurant|Arthur J. Gallagher & Co.|Akamai Technologies|Albemarle Corporation|Align Technology|Allstate|Allegion|Applied Materials|Amcor|Advanced Micro Devices|Ametek|Amgen|Ameriprise Financial|American Tower|Amazon|Arista Networks|Aon plc|A. O. Smith|APA Corporation|Air Products|Amphenol|Apollo Global Management|AppLovin|Aptiv|Alexandria Real Estate Equities|Ares Management|Atmos Energy|AvalonBay Communities|Broadcom|Avery Dennison|American Water Works|Axon Enterprise|American Express|AutoZone|Boeing|Bank of America|Ball Corporation|Baxter International|Best Buy|Becton Dickinson|Franklin Resources|Brown\u2013Forman|Bunge Global|Biogen|Booking Holdings|Baker Hughes|Builders FirstSource|BlackRock|Bristol Myers Squibb|BNY Mellon|Broadridge Financial Solutions|Berkshire Hathaway|Brown & Brown|Boston Scientific|Blackstone Inc.|BXP, Inc.|Citigroup|Cardinal Health|Carrier Global|Casey's|Caterpillar Inc.|Chubb Limited|Cboe Global Markets|CBRE Group|Crown Castle|Carnival Corporation|Cadence Design Systems|CDW Corporation|Constellation Energy|CF Industries|Citizens Financial Group|Church & Dwight|C.H. Robinson|Charter Communications|Cigna|Ciena|Cincinnati Financial|Colgate-Palmolive|Clorox|Comcast|CME Group|Chipotle Mexican Grill|Cummins|CMS Energy|Centene Corporation|CenterPoint Energy|Capital One|Coherent Corp.|Coinbase|Cooper Companies (The)|ConocoPhillips|Cencora|Costco|Corpay|Copart|Camden Property Trust|CRH plc|Charles River Laboratories|Salesforce|CrowdStrike|Cisco|CoStar Group|CSX Corporation|Cintas|Cognizant|Corteva|Carvana|CVS Health|Chevron Corporation|Dominion Energy|Delta Air Lines|DoorDash|DuPont|Datadog|Deere & Company|Deckers Brands|Dell Technologies|Dollar General|Quest Diagnostics|D. R. Horton|Danaher Corporation|Walt Disney Company (The)|Digital Realty|Dollar Tree|Healthpeak Properties|Dover Corporation|Dow Inc.|Domino's|Darden Restaurants|DTE Energy|Duke Energy|DaVita|Devon Energy|Dexcom|Electronic Arts|eBay Inc.|EchoStar|Ecolab|Consolidated Edison|Equifax|Everest Group|Edison International|Est\u00e9e Lauder Companies (The)|Elevance Health|Emcor|Emerson Electric|EOG Resources|Equinix|Equity Residential|EQT Corporation|Erie Indemnity|Eversource Energy|Essex Property Trust|Eaton Corporation|Entergy|Evergy|Edwards Lifesciences|Exelon|Expand Energy|Expeditors International|Expedia Group|Extra Space Storage|Ford Motor Company|Diamondback Energy|Fastenal|Freeport-McMoRan|FactSet|FedEx|FedEx Freight|FirstEnergy|F5, Inc.|Fair Isaac|Fidelity National Information Services|Fiserv|Fifth Third Bancorp|Comfort Systems USA|Flex Ltd.|Fox Corporation (Class B)|Fox Corporation (Class A)|Federal Realty Investment Trust|First Solar|Fortinet|Fortive|General Dynamics|GoDaddy|GE Aerospace|GE HealthCare|Gen Digital|GE Vernova|Gilead Sciences|General Mills|Globe Life|Corning Inc.|General Motors|Generac|Alphabet Inc. (Class C)|Alphabet Inc. (Class A)|Genuine Parts Company|Global Payments|Garmin|Goldman Sachs|W. W. Grainger|Halliburton|Hasbro|Huntington Bancshares|HCA Healthcare|Home Depot (The)|Hartford (The)|Huntington Ingalls Industries|Hilton Worldwide|Honeywell Technologies|Honeywell Aerospace|Robinhood Markets|Hewlett Packard Enterprise|HP Inc.|Hormel Foods|Henry Schein|Host Hotels & Resorts|Hershey Company (The)|Hubbell Incorporated|Humana|Howmet Aerospace|Interactive Brokers|IBM|Intercontinental Exchange|Idexx Laboratories|IDEX Corporation|International Flavors & Fragrances|Incyte|Intel|Intuit|Invitation Homes|International Paper|IQVIA|Ingersoll Rand|Iron Mountain|Intuitive Surgical|Gartner|Illinois Tool Works|Invesco|Jacobs Solutions|J.B. Hunt|Jabil|Johnson Controls|Jack Henry & Associates|Johnson & Johnson|JPMorgan Chase|Keurig Dr Pepper|KeyCorp|Keysight Technologies|Kraft Heinz|Kimco Realty|KKR & Co.|KLA Corporation|Kimberly-Clark|Kinder Morgan|Coca-Cola Company (The)|Kroger|Kenvue|Loews Corporation|Leidos|Lennar|Labcorp|L3Harris|Lennox International|Linde plc|Lumentum|Lilly (Eli)|Lockheed Martin|Alliant Energy|Lowe's|Lam Research|Lululemon Athletica|Southwest Airlines|Las Vegas Sands|LyondellBasell|Live Nation Entertainment|Mastercard|Mid-America Apartment Communities|Marriott International|Masco|McDonald's|Microchip Technology|McKesson Corporation|Moody's Corporation|Mondelez International|Medtronic|MetLife|Meta Platforms|MGM Resorts|McCormick & Company|Martin Marietta Materials|3M|Monster Beverage|Altria|Mosaic Company (The)|Marathon Petroleum|Monolithic Power Systems|Merck & Co.|Moderna|Marsh McLennan|Marvell Technology|Morgan Stanley|MSCI Inc.|Microsoft|Motorola Solutions|M&T Bank|Mettler Toledo|Micron Technology|Norwegian Cruise Line Holdings|Nasdaq, Inc.|Nordson Corporation|NextEra Energy|Newmont|Netflix|NiSource|Nike, Inc.|Northrop Grumman|ServiceNow|NRG Energy|Norfolk Southern|NetApp|Northern Trust|Nucor|Nvidia|NVR, Inc.|News Corp (Class B)|News Corp (Class A)|NXP Semiconductors|Realty Income|Old Dominion|Oneok|Omnicom Group|ON Semiconductor|Oracle Corporation|O\u2019Reilly Automotive|Otis Worldwide|Occidental Petroleum|Palo Alto Networks|Paychex|Paccar|PG&E Corporation|Public Service Enterprise Group|PepsiCo|Pfizer|Principal Financial Group|Procter & Gamble|Progressive Corporation|Parker Hannifin|PulteGroup|Packaging Corporation of America|Prologis|Palantir Technologies|Philip Morris International|PNC Financial Services|Pentair|Pinnacle West Capital|Insulet Corporation|PPG Industries|PPL Corporation|Prudential Financial|Public Storage|Paramount Skydance Corporation|Phillips 66|PTC Inc.|Quanta Services|PayPal|Qnity Electronics|Qualcomm|Royal Caribbean Group|Regency Centers|Regeneron Pharmaceuticals|Regions Financial Corporation|Raymond James Financial|Ralph Lauren Corporation|ResMed|Rockwell Automation|Rollins, Inc.|Roper Technologies|Ross Stores|Republic Services|RTX Corporation|Revvity|SBA Communications|Starbucks|Charles Schwab Corporation|Sherwin-Williams|J.M. Smucker Company (The)|Schlumberger|Supermicro|Snap-on|Sandisk|Synopsys|Southern Company|Solventum|Simon Property Group|S&P Global|Sempra|Steris|Steel Dynamics|State Street Corporation|Seagate Technology|Constellation Brands|Smurfit Westrock|Stanley Black & Decker|Skyworks Solutions|Synchrony Financial|Stryker Corporation|Sysco|AT&T|Molson Coors Beverage Company|TransDigm Group|Teledyne Technologies|Bio-Techne|TE Connectivity|Teradyne|Truist Financial|Target Corporation|TJX Companies|TKO Group Holdings|Thermo Fisher Scientific|T-Mobile US|Texas Pacific Land Corporation|Tapestry, Inc.|Targa Resources|Trimble Inc.|T. Rowe Price|Travelers Companies (The)|Tractor Supply|Tesla, Inc.|Tyson Foods|Trane Technologies|Trade Desk (The)|Take-Two Interactive|Texas Instruments|Textron|Tyler Technologies|United Airlines Holdings|Uber|UDR, Inc.|Universal Health Services|Ulta Beauty|UnitedHealth Group|Union Pacific Corporation|United Parcel Service|United Rentals|U.S. Bancorp|Visa Inc.|Veeva Systems|Vici Properties|Valero Energy|Veralto|Vulcan Materials Company|Verisk Analytics|Verisign|Vertiv|Vertex Pharmaceuticals|Vistra Corp.|Ventas|Viatris|Verizon|Wabtec|Waters Corporation|Warner Bros. Discovery|Workday, Inc.|Western Digital|WEC Energy Group|Welltower|Wells Fargo|Waste Management|Williams Companies|Walmart|W. R. Berkley Corporation|Williams-Sonoma, Inc.|West Pharmaceutical Services|Willis Towers Watson|Weyerhaeuser|Wynn Resorts|Xcel Energy|ExxonMobil|Xylem Inc.|Block, Inc.|Yum! Brands|Zimmer Biomet|Zebra Technologies|Zoetis","s":"575154777267aaa4444785467876549174638747194a978a6416485154225136454644549456264499177a84260574220416a5a47453524698577796678153a6187617251509296811aa5350108a64a256639934a96aa5a36191368466a774446700977667657652471600141463145146166477259265647456857798569576466764542472947232224615668756a171618049161754254012862283755474477457146a80a167a674871007963077163766aa2542461897246a58a490376477195441566716659148237677a594a58472867452026757742105031374411260076766951566644593686765a95065077a94632415491a3641575","u":"27,3b,c,1p,1e,2s,1s,7,33,3,1r,7,2d,10,1t,26,2e,2e,1y,23,37,1i,2s,g,32,2n,33,11,c,8,3c,f,l,1y,g,2h,1v,12,8,7,a,2f,8,1b,2b,33,2n,3h,1,r,b,1,y,29,1e,m,1e,8,w,3,c,1p,2g,g,8,2r,8,v,2c,1y,1e,8,2f,y,1d,g,19,o,2s,17,2v,3c,1p,7,3a,10,16,2w,1q,4,h,1h,l,2s,1q,1q,h,17,2z,o,2d,28,2d,r,12,17,1i,2h,1d,s,3g,z,2b,p,27,7,39,l,2v,2u,z,1s,16,b,1h,1z,2d,2o,36,37,7,2,1a,3b,s,1h,1m,27,2a,u,s,1g,1w,k,2z,2z,2d,10,1h,2h,1e,21,f,3i,37,2d,2y,2x,10,2q,28,n,11,2h,u,2b,2h,1y,10,2b,11,10,10,1e,10,2h,4,1p,31,9,2h,3f,t,17,4,i,10,l,7,3g,3g,2w,n,14,e,e,30,33,39,1w,1,23,1,1e,39,1k,c,2m,26,12,9,1k,22,22,x,3g,q,24,1w,2g,25,2w,1f,1l,2s,1,1p,1u,1,24,3b,3b,2m,1d,1o,2m,1w,28,1,24,1s,17,1e,1w,37,c,33,7,34,2n,27,1w,2k,1e,1s,1w,8,n,i,14,g,3g,2r,y,35,2w,13,2m,30,8,32,1q,2j,35,19,2q,2e,z,1m,1h,1,g,1v,l,2r,1,10,1l,32,6,2o,j,37,2a,3g,2b,1p,g,2z,33,1d,17,2m,1e,26,22,j,2m,p,1u,35,3e,16,2i,33,2r,c,1y,33,24,17,39,l,2w,27,33,1p,17,1w,2d,1c,2a,2d,6,1,39,1t,2u,3b,8,38,33,1m,2t,2t,33,30,i,2j,0,33,7,b,1w,2h,39,1r,o,2d,10,35,2r,26,2q,2s,1w,1m,2n,1x,7,3e,y,1w,2d,1e,37,10,26,31,2a,2i,7,n,3g,32,33,1p,30,c,2w,24,6,1e,11,15,13,5,15,1,1e,3c,2z,24,37,2m,2g,3b,1w,3b,7,10,1j,30,17,2d,1e,38,8,3b,w,2n,1w,33,r,1e,18,20,d,1,13,27,14,32,y,s,5,2a,27,3i,2h,6,2j,7,8,2s,2l,9,2m,g,0,21,33,1,7,2o,2p,2b,1f,2l,28,2u,4,3f,y,3g,1j,1o,2i,15,p,2y,23,11,c,10,1g,2r,20,o,27,e,7,3b,10,1g,y,15,2j,s,2s,1n,1i,1y,3d,j,2d,1z,1w,3g,2z,1e,13,2r","c":"ndq0,6v29,x8vk,xfhk,1e0,kb30,vg8d,h2gn,4uh,5gs,6ou,gho5,lhum,3s8,iqyx,3u9,42g,r5t2,7lam,na4u,jmq1,nikd,j9pn,xujt,5d3,11hdi,1x4,m8to,6thm,hkqj,mkw3,lu1w,y7w4,6ra5,1ybq,13h1e,2ah,hkyh,13u61,11j34,wlv8,m6yb,p850,fonu,jmq0,11308,6sy,u8gc,mwzj,3tu,iktf,9z3,1ioa,78t,82g,gdvi,8bv,tx5,bc5,16sse,ir6t,n1vv,10gyt,s82r,174rj,b0g,tt4p,tndc,mw27,1p6a,izfh,tvh6,m8kk,ht7d,fgm3,127ws,fkxa,e2e,j7hb,tgfa,oe6e,mjbi,hgxl,hfu0,u1u1,141kj,sdx0,gadk,6q87,mczx,nec3,11ajo,k2iz,fni,gpt,g9g,p083,os9j,mofe,k70,hdw4,myyj,o85i,jvrg,hkym,1004s,f8x8,oxi5,ogaj,ji14,p6zi,jai3,jfc9,i7eb,nlai,nrcc,wwtj,iepp,mnuw,5ygs,fi2e,moky,11moo,108n8,1e03,202q,fcfp,lj4,12fbp,zq18,xgwe,6r79,jik9,xoyk,mse,lwn3,iwp4,6pzk,11e21,rtjg,k1zr,geyg,n2p,11jos,rkt5,k61c,k2hg,sf9s,jvbu,nd24,nfsl,f9s3,mtts,uc4s,o9y,mgja,plt,ngyp,hq5o,lgki,os07,29ia,p5o,hlmt,nlpz,jf5n,pml,jrwd,1k4l,jqa2,x8we,1eww,10of9,nkm0,nrzh,j6om,g00j,sdxk,rmz6,tbg,x05a,hhac,htej,lpth,mhcf,18mo7,m3r4,mh6f,hgib,od8d,h40i,rev,m7db,ikhy,11lml,11lml,qxj,rbem,r1sn,zk7y,v9x,yi27,va9,15f1l,i7ef,16sqy,iwmn,veo,6v67,j39,vglu,vlwv,zeq4,zeq4,vmj,o2sg,o1ks,j0ee,5xu7,yqc,zk0,11yk,ig56,7lvq,iqz2,w6mp,xzix,gl3k,18s3b,128g7,z9qu,10fl,11e9,lfs4,my72,10cn,11qa,11v3,3ax,tlql,13gn,xox9,iqxo,hu1x,13jp,iudd,138v,j81a,105vh,13oq,voma,10f2m,lvh5,m6tf,g24j,12g2,jleo,14vw,fm53,j94l,hv38,gp74,4amu,f4x,ue8n,1yns,ybdi,z3gz,iubh,u41c,6uap,171l,wa9v,ggw,17vt,15o1c,1ad2,snko,jqgo,jpzo,4bwq,mx02,10lud,z0sa,19w6,k2l0,7k0t,1at7,f5y5,ty2r,1za4,rvhe,vx81,smai,ogpb,jk5v,mgv2,1clw,1db8,hq5q,jvs5,mpk4,nnu6,ykof,nk5v,sfrl,gx8i,1d6y,jmuk,1fhw,ik0o,gdn8,rk49,wdcn,rg04,6nbi,102hw,1cdx,13cds,j6wt,u6km,gwt7,1gux,rzi,m8ni,fhyt,wg0x,o0ch,1jt7,g598,oypj,mtz4,ntsv,6v23,oajx,tfyr,lqb3,f1sl,lh6n,1kf8,1kkd,meya,jf77,xjc4,xjc4,uamf,fkqw,iu6n,ma84,n51,nj48,sr27,j919,126hj,h3bw,sgcv,fia3,1m5e,ljg4,gwmo,1ns4,1o6r,o52w,1q20,1q8l,1mwe,hmkw,1me5,mesp,sbsn,uaj5,faoc,1now,gdzi,ojn1,1pmv,jrlc,odwu,tv33,17rbe,ww6l,id9p,miw3,z0ql,184mx,h8mg,iys7,jimm,ipal,rh0h,ffk5,m86m,k897,lyhq,1tgn,ix77,fzes,mq7b,26kl,oj3,m5vq,hru0,6sdh,1xag,1yjf,1veb,th8l,1yk0,17ddu,ixih,1z2y,16402,mssx,1dew,m4gg,11oei,lx3j,20c7,odx9,d1y,16zsv,206s,36n,ybw0,6nsc,2239,fpd9,ixt,r0e5,ngct,i1pj,tosl,230a,1z5y,l5n,2c9a,16aky,23f5,riib,12tfm,nx7o,trw2,ij8t,nuxd,1ulk,jn2l,s9fx,25jh,vfde,zu2l,kadx,237o,4npe,ig57,25k5,x2pb,1l9c,7kb7,u300,fomu,25ud,ndlz,mvud,ruw,u2op,tuvw,10k4g,m6m2,1669s,tx61,uwrl,lqrt,zvqt,ireg,10a6r,fv6s,12er0,fpd4,k7z0,lg55,usvn,sgjn,29tk,gsf1,gflc,1kaz,hnmg,2arj,28dl,8wo,ffir,29m2,og1k,2a7b,p6kq,1k93,qaw,woag,wf6p,mbad,od7p,isv0,xc28"};
const FILEBYTES = 55734;
const UNI=(function(B){const t=B.t.split(','),n=B.n.split('|'),u=B.u.split(','),c=B.c.split(',');const o=[];
for(let i=0;i<t.length;i++)o.push({t:t[i],n:n[i],s:B.sec[parseInt(B.s[i],36)],u:B.sub[parseInt(u[i],36)],cik:parseInt(c[i],36)});return o;})(BLOB);
const BYT=Object.fromEntries(UNI.map(r=>[r.t,r]));
const KEYS={fh:'',av:''};
const CALLS={fh:0,av:0};
let REMEMBER=true;
const D={}; // ticker -> metric record
let SUBJ='NVDA';
let SET=[]; // tickers in comp set (excluding subject)
let OFF={}; // ticker -> true if excluded from stats
let sortK='mktCap', sortD=-1;
/* ---------- theme ---------- */
let THEME='light';
function applyTheme(t){THEME=(t==='dark')?'dark':'light';
document.documentElement.dataset.theme=THEME;
const b=document.getElementById('themebtn'); if(b) b.textContent=(THEME==='dark')?'Light':'Dark';
}
async function loadTheme(){let r=null;
try{ if(window.storage){const g=await window.storage.get('screener02:theme'); r=g&&g.value;} else r=localStorage.getItem('screener02:theme'); }catch(e){}
applyTheme(r==='dark'?'dark':'light');}
async function saveTheme(){try{ if(window.storage) await window.storage.set('screener02:theme',THEME); else localStorage.setItem('screener02:theme',THEME);}catch(e){}}
/* ---------- helpers ---------- */
const $=s=>document.querySelector(s), $$=s=>[...document.querySelectorAll(s)];
const esc=s=>String(s??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
const clean=s=>String(s??'').toUpperCase().replace(/[^A-Z0-9.\-]/g,'').slice(0,12);
const num=v=>{const n=typeof v==='string'?parseFloat(v.replace(/,/g,'')):v; return (n==null||!isFinite(n))?null:n;};
const N=(v,d=2)=>v==null||!isFinite(v)?null:v.toLocaleString('en-US',{minimumFractionDigits:d,maximumFractionDigits:d});
const P=v=>v==null||!isFinite(v)?null:(v>=0?'+':'')+v.toFixed(1)+'%';
function C(v){ if(v==null||!isFinite(v)) return null; const neg=v<0; v=Math.abs(v);
for(const [n,s] of [[1e12,'T'],[1e9,'B'],[1e6,'M'],[1e3,'K']]) if(v>=n) return (neg?'-':'')+(v/n).toFixed(v/n>=100?0:v/n>=10?1:2)+s;
return (neg?'-':'')+v.toFixed(0); }
const setStatus=s=>$('#status').textContent=s;
const sleep=ms=>new Promise(r=>setTimeout(r,ms));
async function jget(u){const r=await fetch(u,{cache:'no-store'}); if(!r.ok) throw new Error(r.status); return r.json();}
function fill(o,k,v){ if(o[k]==null && v!=null && v!==''&&v!=='None'&&v!=='-'&&isFinite(v)) o[k]=v; }
/* ---------- metric definitions ---------- */
const M=[
{k:'mktCap', h:'Mkt cap', f:C, grp:'Size'},
{k:'price', h:'Price', f:v=>N(v)},
{k:'chgPct', h:'Chg %', f:P, sign:1},
{k:'pe', h:'P/E', f:v=>N(v,1), mult:1, dist:1},
{k:'fwdPe', h:'Fwd P/E', f:v=>N(v,1), mult:1, dist:1},
{k:'peg', h:'PEG', f:v=>N(v,2), mult:1, dist:1},
{k:'ps', h:'P/S', f:v=>N(v,2), mult:1, dist:1},
{k:'pb', h:'P/B', f:v=>N(v,2), mult:1, dist:1},
{k:'evEbitda', h:'EV/EBITDA', f:v=>N(v,1), mult:1, dist:1},
{k:'revGrowth', h:'Rev growth', f:P, sign:1, dist:1},
{k:'epsGrowth', h:'EPS growth', f:P, sign:1, dist:1},
{k:'grossMargin', h:'Gross mgn', f:P, sign:1, dist:1},
{k:'operMargin', h:'Oper mgn', f:P, sign:1, dist:1},
{k:'netMargin', h:'Net mgn', f:P, sign:1, dist:1},
{k:'roe', h:'ROE', f:P, sign:1, dist:1},
{k:'roa', h:'ROA', f:P, sign:1, dist:1},
{k:'debtEq', h:'Debt/Eq', f:v=>N(v,2), dist:1},
{k:'currentRatio',h:'Current', f:v=>N(v,2), dist:1},
{k:'divYield', h:'Div yield', f:v=>v==null?null:v.toFixed(2)+'%', dist:1},
{k:'beta', h:'Beta', f:v=>N(v,2), dist:1},
];
const MBY=Object.fromEntries(M.map(m=>[m.k,m]));
/* ---------- fetching ---------- */
async function fetchOne(t){
const o=D[t]||{t,name:BYT[t]?BYT[t].n:t,sector:BYT[t]?BYT[t].s:null,sub:BYT[t]?BYT[t].u:null,src:[]};
if(KEYS.fh){
const K=encodeURIComponent(KEYS.fh);
try{ CALLS.fh++; const q=await jget(`https://finnhub.io/api/v1/quote?symbol=${encodeURIComponent(t)}&token=${K}`);
if(q&&q.c){ fill(o,'price',q.c); fill(o,'chgPct',q.dp); o.src.push('Finnhub'); } }catch(e){}
try{ CALLS.fh++; const p=await jget(`https://finnhub.io/api/v1/stock/profile2?symbol=${encodeURIComponent(t)}&token=${K}`);
if(p&&p.name){ if(!BYT[t]){o.name=o.name===t?p.name:o.name; o.sub=o.sub||p.finnhubIndustry;}
fill(o,'mktCap',num(p.marketCapitalization)*1e6); } }catch(e){}
try{ CALLS.fh++; const d=await jget(`https://finnhub.io/api/v1/stock/metric?symbol=${encodeURIComponent(t)}&metric=all&token=${K}`);
const m=d&&d.metric; if(m){ const g=k=>num(m[k]);
fill(o,'pe',g('peTTM')??g('peBasicExclExtraTTM')); fill(o,'ps',g('psTTM')); fill(o,'pb',g('pbQuarterly')??g('pbAnnual'));
fill(o,'revGrowth',g('revenueGrowthTTMYoy')); fill(o,'epsGrowth',g('epsGrowthTTMYoy'));
fill(o,'grossMargin',g('grossMarginTTM')); fill(o,'operMargin',g('operatingMarginTTM')); fill(o,'netMargin',g('netProfitMarginTTM'));
fill(o,'roe',g('roeTTM')??g('roeRfy')); fill(o,'roa',g('roaTTM')??g('roaRfy'));
fill(o,'debtEq',g('totalDebt/totalEquityQuarterly')); fill(o,'currentRatio',g('currentRatioQuarterly'));
fill(o,'divYield',g('dividendYieldIndicatedAnnual')); fill(o,'beta',g('beta'));
} }catch(e){}
}
if(KEYS.av){
try{ CALLS.av++;
const d=await jget(`https://www.alphavantage.co/query?function=OVERVIEW&symbol=${encodeURIComponent(t)}&apikey=${encodeURIComponent(KEYS.av)}`);
if(d&&d.Symbol){ const g=k=>num(d[k]);
if(!BYT[t]){ o.name=o.name===t?d.Name:o.name; o.sector=o.sector||d.Sector; o.sub=o.sub||d.Industry; }
fill(o,'mktCap',g('MarketCapitalization'));
fill(o,'pe',g('TrailingPE')); fill(o,'fwdPe',g('ForwardPE')); fill(o,'peg',g('PEGRatio'));
fill(o,'ps',g('PriceToSalesRatioTTM')); fill(o,'pb',g('PriceToBookRatio')); fill(o,'evEbitda',g('EVToEBITDA'));
fill(o,'netMargin',g('ProfitMargin')*100); fill(o,'operMargin',g('OperatingMarginTTM')*100);
fill(o,'roe',g('ReturnOnEquityTTM')*100); fill(o,'roa',g('ReturnOnAssetsTTM')*100);
fill(o,'epsGrowth',g('QuarterlyEarningsGrowthYOY')*100); fill(o,'revGrowth',g('QuarterlyRevenueGrowthYOY')*100);
fill(o,'divYield',g('DividendYield')*100); fill(o,'beta',g('Beta'));
o.src.push('Alpha Vantage');
} else if(d&&(d.Note||d.Information)) setStatus('Alpha Vantage daily limit reached');
}catch(e){}
}
o.loaded=o.src.length>0;
D[t]=o; return o;
}
async function fetchMany(list,onProg){
let done=0;
for(const t of list){
await fetchOne(t);
done++; onProg&&onProg(done,list.length);
renderQuota(); await sleep(KEYS.fh?350:900);
}
}
async function apiPeers(t){
if(!KEYS.fh) return [];
try{ CALLS.fh++;
const d=await jget(`https://finnhub.io/api/v1/stock/peers?symbol=${encodeURIComponent(t)}&token=${encodeURIComponent(KEYS.fh)}`);
return Array.isArray(d)?d.filter(x=>x&&x!==t):[];
}catch(e){ return []; }
}
/* ---------- peer selection ---------- */
async function peersFor(t,mode,cap){
const b=BYT[t];
if(mode==='man') return $('#manlist').value.split(/[,\s]+/).map(clean).filter(x=>x&&x!==t).slice(0,cap);
if(mode==='api'){ const p=await apiPeers(t); if(p.length) return p.slice(0,cap);
setStatus('Provider returned no peers — falling back to sub-industry'); }
if(!b){ setStatus(t+' is not in the baked S&P 500 map — use a manual list'); return []; }
const key=(mode==='sec')?'s':'u';
let out=UNI.filter(u=>u[key]===b[key]&&u.t!==t).map(u=>u.t);
if(key==='u'&&out.length<3){
const wider=UNI.filter(u=>u.s===b.s&&u.t!==t&&!out.includes(u.t)).map(u=>u.t);
setStatus(`Only ${out.length} S&P peer${out.length===1?'':'s'} in ${b.u} — widened to the ${b.s} sector`);
out=out.concat(wider);
}
return out.slice(0,cap);
}
/* ---------- statistics ---------- */
function stats(vals,positiveOnly){
let v=vals.filter(x=>x!=null&&isFinite(x));
if(positiveOnly) v=v.filter(x=>x>0);
if(!v.length) return null;
v.sort((a,b)=>a-b);
const q=p=>{ const i=(v.length-1)*p, lo=Math.floor(i), hi=Math.ceil(i);
return lo===hi?v[lo]:v[lo]+(v[hi]-v[lo])*(i-lo); };
return {n:v.length,min:v[0],max:v[v.length-1],q1:q(.25),med:q(.5),q3:q(.75),vals:v};
}
function pctRank(st,x){
if(!st||x==null||!isFinite(x)) return null;
const below=st.vals.filter(v=>v<x).length, eq=st.vals.filter(v=>v===x).length;
return (below+eq/2)/st.vals.length*100;
}
const active=()=>SET.filter(t=>!OFF[t]);
/* ---------- render: comp table ---------- */
function renderCmp(){
const rows=[SUBJ,...SET];
const wrap=$('#cmpwrap');
if(!SET.length&&!D[SUBJ]){
wrap.innerHTML=`<div class="empty" style="border:0"><h3>No comparison set yet</h3>
<p>Enter a subject ticker and press Build comp set. Peers come from the baked GICS map at no API cost; metrics cost about three calls each.</p></div>`;
$('#chips').innerHTML=''; $('#cmpnote').textContent=''; $('#cmpfoot').textContent=''; return;
}
const st={}; M.forEach(m=>{ st[m.k]=stats(active().map(t=>D[t]&&D[t][m.k]),m.mult); });
let peers=SET.slice();
if(sortK) peers.sort((a,b)=>{
const x=D[a]&&D[a][sortK], y=D[b]&&D[b][sortK];
if(x==null&&y==null) return 0; if(x==null) return 1; if(y==null) return -1;
return typeof x==='string'?x.localeCompare(y)*sortD:(x-y)*sortD; });
const th=`<tr><th class="stick">Ticker</th><th>Company</th>`+
M.map(m=>`<th class="num" data-k="${m.k}">${esc(m.h)}${sortK===m.k?`<span class="ar">${sortD>0?'▲':'▼'}</span>`:''}</th>`).join('')+
`<th class="num">In set</th></tr>`;
const row=(t,isSub)=>{
const o=D[t]||{t,name:BYT[t]?BYT[t].n:t};
return `<tr class="${isSub?'subject':''} ${!isSub&&OFF[t]?'off':''}">
<td class="tkr stick">${esc(t)}</td>
<td class="dim">${esc((o.name||t).slice(0,30))}</td>`+
M.map(m=>{
const v=o[m.k], txt=v==null?'—':(m.f(v)??'—');
const cls=m.sign&&v!=null?(v>=0?'up':'down'):'';
return `<td class="num ${cls}">${esc(txt)}</td>`;}).join('')+
`<td class="num">${isSub?'<span class="lbl">subject</span>':
`<input type="checkbox" class="cbx" data-off="${esc(t)}" ${OFF[t]?'':'checked'}>`}</td></tr>`;
};
const foot=`<tr><td class="stick">Median</td><td class="dim">${active().length} peers in stats</td>`+
M.map(m=>`<td class="num">${st[m.k]?esc(m.f(st[m.k].med)??'—'):'—'}</td>`).join('')+`<td></td></tr>`;
wrap.innerHTML=`<table><thead>${th}</thead><tbody>${row(SUBJ,true)}${peers.map(t=>row(t,false)).join('')}</tbody><tfoot>${foot}</tfoot></table>`;
$$('#cmpwrap th[data-k]').forEach(h=>h.onclick=()=>{
const k=h.dataset.k; if(sortK===k) sortD*=-1; else {sortK=k; sortD=-1;} renderCmp(); });
$$('#cmpwrap [data-off]').forEach(c=>c.onchange=()=>{ OFF[c.dataset.off]=!c.checked; renderCmp(); renderDist(); persist(); });
$('#chips').innerHTML=SET.map(t=>`<span class="chip">${esc(t)}<x data-rm="${esc(t)}">×</x></span>`).join('');
$$('#chips [data-rm]').forEach(x=>x.onclick=()=>{
SET=SET.filter(y=>y!==x.dataset.rm); delete OFF[x.dataset.rm]; renderCmp(); renderDist(); persist(); });
const loaded=rows.filter(t=>D[t]&&D[t].loaded).length;
$('#cmpnote').textContent=`${SET.length} peers · ${loaded} of ${rows.length} with metrics`;
const b=BYT[SUBJ];
$('#cmpfoot').textContent=(b?`${b.n} · ${b.s} · ${b.u}. `:'')+
`Median row uses only checked peers. Non-positive multiples are dropped from multiple statistics so loss-making peers do not distort them.`;
}
/* ---------- render: distribution ---------- */
function renderDist(){
const el=$('#dist'), sub=D[SUBJ];
const peers=active().map(t=>D[t]).filter(Boolean);
if(!sub||peers.length<2){
el.innerHTML=`<div class="empty" style="border:0"><h3>Not enough loaded peers</h3>
<p>Load metrics for the subject and at least two peers to see where it sits in the distribution.</p></div>`; return; }
let h='';
for(const m of M){
if(!m.dist) continue;
const st=stats(peers.map(o=>o[m.k]),m.mult);
const x=sub[m.k];
if(!st||st.n<2) continue;
const lo=Math.min(st.min,(m.mult&&x<=0)?st.min:(x??st.min));
const hi=Math.max(st.max,(m.mult&&x<=0)?st.max:(x??st.max));
const span=(hi-lo)||1;
const pos=v=>((v-lo)/span*100);
const pr=pctRank(st,(m.mult&&x<=0)?null:x);
const showMe=x!=null&&isFinite(x)&&!(m.mult&&x<=0);
h+=`<div class="drow">
<div class="dname">${esc(m.h)}<small>n=${st.n}</small></div>
<div class="strip">
<div class="axis"></div>
<div class="box" style="left:${pos(st.q1).toFixed(2)}%;width:${(pos(st.q3)-pos(st.q1)).toFixed(2)}%"></div>
${st.vals.map(v=>`<div class="pt" style="left:${pos(v).toFixed(2)}%"></div>`).join('')}
<div class="med" style="left:${pos(st.med).toFixed(2)}%"></div>
${showMe?`<div class="me" style="left:${pos(x).toFixed(2)}%" data-v="${esc(m.f(x)??'')}"></div>`:''}
<div class="dends"><span>${esc(m.f(st.min)??'')}</span><span>med ${esc(m.f(st.med)??'')}</span><span>${esc(m.f(st.max)??'')}</span></div>
</div>
<div class="dpct">${pr==null?'<span class="lbl">n/a</span>':`<b>${pr.toFixed(0)}<span style="font-size:9px">th</span></b><span class="lbl">pctile</span>`}</div>
</div>`;
}
el.innerHTML=h||'<div class="empty" style="border:0"><h3>No comparable metrics loaded</h3></div>';
}
/* ---------- render: universe ---------- */
function uniRows(){
const q=$('#u_q').value.trim().toUpperCase(), sec=$('#u_sec').value, sub=$('#u_sub').value;
const mk=$('#u_met').value, mn=parseFloat($('#u_min').value), mx=parseFloat($('#u_max').value);
return UNI.filter(u=>{
if(q&&!(u.t.includes(q)||u.n.toUpperCase().includes(q))) return false;
if(sec&&u.s!==sec) return false;
if(sub&&u.u!==sub) return false;
if(mk&&(!isNaN(mn)||!isNaN(mx))){
const v=D[u.t]&&D[u.t][mk]; if(v==null) return false;
if(!isNaN(mn)&&v<mn) return false; if(!isNaN(mx)&&v>mx) return false;
}
return true; });
}
function renderUni(){
const rows=uniRows(), mk=$('#u_met').value, m=MBY[mk];
$('#uniwrap').innerHTML=`<table><thead><tr>
<th class="stick">Ticker</th><th>Company</th><th>Sector</th><th>Sub-industry</th>
<th class="num">${m?esc(m.h):'—'}</th><th class="num">Add</th></tr></thead><tbody>${
rows.slice(0,300).map(u=>{
const v=D[u.t]&&m?D[u.t][mk]:null;
return `<tr><td class="tkr stick">${esc(u.t)}</td><td class="dim">${esc(u.n)}</td>
<td class="dim">${esc(u.s)}</td><td class="dim">${esc(u.u)}</td>
<td class="num">${v==null?'—':esc(m.f(v)??'—')}</td>
<td class="num"><button class="btn sm" data-add="${esc(u.t)}">${SET.includes(u.t)||u.t===SUBJ?'✓':'+'}</button></td></tr>`;
}).join('')}</tbody></table>`;
$$('#uniwrap [data-add]').forEach(b=>b.onclick=()=>addToSet(b.dataset.add));
$('#unifoot').textContent=`${rows.length} of 503 match${rows.length>300?' · showing first 300':''}. `+
`Sector and sub-industry filters are instant and free. Numeric filters can only see the ${Object.values(D).filter(o=>o.loaded).length} companies whose metrics you have loaded.`;
}
/* ---------- actions ---------- */
function addToSet(t){
t=clean(t); if(!t||t===SUBJ||SET.includes(t)) return;
SET.push(t); persist(); renderCmp(); renderUni();
if(!D[t]||!D[t].loaded){ if(KEYS.fh||KEYS.av) fetchMany([t]).then(()=>{renderCmp();renderDist();renderUni();}); }
}
async function build(){
const t=clean($('#subj').value); if(!t) return;
SUBJ=t; OFF={};
const mode=$('#pmode').value, cap=+$('#pcap').value;
setStatus('Selecting peers…');
SET=await peersFor(t,mode,cap);
persist(); renderCmp(); renderUni();
if(!KEYS.fh&&!KEYS.av){
setStatus(`${SET.length} peers selected — add a key to load metrics`);
$('#keys').classList.add('open'); return; }
const list=[t,...SET];
const est=Math.ceil(list.length*(KEYS.fh?3:1));
setStatus(`Loading ${list.length} companies · about ${est} calls`);
$('#build').disabled=true;
await fetchMany(list,(d,n)=>{ $('#pbar').style.width=(d/n*100)+'%'; renderCmp(); });
$('#build').disabled=false;
renderCmp(); renderDist(); renderUni();
setStatus('Comp set ready');
}
/* ---------- persistence ---------- */
async function persist(){
const d=JSON.stringify({subj:SUBJ,set:SET,off:OFF,keys:REMEMBER?KEYS:{fh:'',av:''},remember:REMEMBER});
try{ if(window.storage) await window.storage.set('screener02',d); else localStorage.setItem('screener02',d); }catch(e){}
}
async function restore(){
let raw=null;
try{ if(window.storage){const r=await window.storage.get('screener02'); raw=r&&r.value;} else raw=localStorage.getItem('screener02'); }catch(e){}
if(!raw) return;
try{ const d=JSON.parse(raw);
SUBJ=d.subj||SUBJ; SET=d.set||[]; OFF=d.off||{};
REMEMBER=d.remember!==false; $('#k_remember').checked=REMEMBER;
Object.assign(KEYS,d.keys||{});
$('#k_fh').value=KEYS.fh||''; $('#k_av').value=KEYS.av||'';
$('#subj').value=SUBJ;
}catch(e){}
}
/* ---------- footer ---------- */
function renderQuota(){
$('#quota').innerHTML=`<span class="lbl">Session API usage</span><br>
Finnhub <b>${CALLS.fh}</b> calls · 60/min cap · ${KEYS.fh?'key set':'no key'}<br>
Alpha Vantage <b>${CALLS.av}</b> / 25 per day · ${KEYS.av?'key set':'no key'}<br>
<span style="color:var(--muted)">A 12-peer set costs about 39 Finnhub calls, or 13 Alpha Vantage calls — half a day's free quota.</span>`;
const l=[KEYS.fh&&'Finnhub',KEYS.av&&'Alpha Vantage'].filter(Boolean);
$('#provline').textContent=l.length?'providers: '+l.join(' · '):'no key — peer selection works, metrics do not';
}
function renderBudget(){
const uni=JSON.stringify(BLOB).length, app=Math.max(0,FILEBYTES-uni), MB=1048576;
$('#gauge').innerHTML=`<i style="width:${(uni/MB*100).toFixed(3)}%;background:var(--link)"></i>
<i style="width:${(app/MB*100).toFixed(3)}%;background:var(--ink2)"></i>
<i style="flex:1;background:repeating-linear-gradient(45deg,transparent,transparent 3px,var(--rule) 3px,var(--rule) 4px)"></i>`;
$('#gkey').textContent=`universe ${(uni/1024).toFixed(1)} KB · app ${(app/1024).toFixed(1)} KB · ${(FILEBYTES/MB*100).toFixed(1)}% of 1 MB used`;
}
/* ---------- wiring ---------- */
function showTab(id){
['cmp','dst','uni'].forEach(t=>$('#tab-'+t).classList.toggle('hidden',t!==id));
$$('.tab').forEach(b=>b.classList.toggle('on',b.dataset.tab===id));
if(id==='dst') renderDist(); if(id==='uni') renderUni();
}
$$('.tab').forEach(b=>b.onclick=()=>showTab(b.dataset.tab));
document.getElementById('themebtn').onclick=()=>{applyTheme(THEME==='dark'?'light':'dark');saveTheme();};
$('#keybtn').onclick=()=>$('#keys').classList.toggle('open');
$('#ksave').onclick=async()=>{
KEYS.fh=$('#k_fh').value.trim(); KEYS.av=$('#k_av').value.trim();
REMEMBER=$('#k_remember').checked;
await persist(); renderQuota();
setStatus(REMEMBER?'Keys saved to this device':'Keys held for this session only');
};
$('#k_remember').onchange=()=>{ REMEMBER=$('#k_remember').checked; persist(); };
$('#pmode').onchange=()=>{ $('#manwrap').style.display=$('#pmode').value==='man'?'flex':'none'; };
$('#build').onclick=build;
$('#subj').onkeydown=e=>{ if(e.key==='Enter') build(); };
$('#addbtn').onclick=()=>{ addToSet($('#addt').value); $('#addt').value=''; };
$('#addt').onkeydown=e=>{ if(e.key==='Enter'){ addToSet($('#addt').value); $('#addt').value=''; } };
$('#loadmiss').onclick=async()=>{
const miss=[SUBJ,...SET].filter(t=>!D[t]||!D[t].loaded);
if(!miss.length){ setStatus('Everything in the set already has metrics'); return; }
if(!KEYS.fh&&!KEYS.av){ $('#keys').classList.add('open'); setStatus('Add a key first'); return; }
setStatus(`Loading ${miss.length} companies…`); $('#loadmiss').disabled=true;
await fetchMany(miss,(d,n)=>{ $('#pbar').style.width=(d/n*100)+'%'; renderCmp(); });
$('#loadmiss').disabled=false; renderCmp(); renderDist(); renderUni(); setStatus('Done');
};
$('#exp').onclick=()=>{
const out={exported:new Date().toISOString(),subject:SUBJ,peers:SET,excluded:Object.keys(OFF).filter(k=>OFF[k]),
medians:Object.fromEntries(M.map(m=>{const s=stats(active().map(t=>D[t]&&D[t][m.k]),m.mult); return [m.k,s?s.med:null];})),
companies:Object.fromEntries([SUBJ,...SET].filter(t=>D[t]).map(t=>[t,D[t]]))};
const b=new Blob([JSON.stringify(out,null,2)],{type:'application/json'});
const a=document.createElement('a'); a.href=URL.createObjectURL(b);
a.download='comp-set-'+SUBJ+'-'+new Date().toISOString().slice(0,10)+'.json'; a.click();
setTimeout(()=>URL.revokeObjectURL(a.href),1000);
};
['#u_q','#u_min','#u_max'].forEach(s=>$(s).oninput=renderUni);
['#u_sec','#u_sub','#u_met'].forEach(s=>$(s).onchange=renderUni);
$('#u_reset').onclick=()=>{ ['#u_q','#u_min','#u_max'].forEach(s=>$(s).value='');
$('#u_sec').value=''; $('#u_sub').value=''; renderUni(); };
$('#u_addall').onclick=()=>{ uniRows().slice(0,+$('#pcap').value).forEach(u=>addToSet(u.t)); showTab('cmp'); };
function clock(){ $('#clock').textContent=new Date().toLocaleString('en-US',{month:'short',day:'numeric',hour:'2-digit',minute:'2-digit'}); }
setInterval(clock,30000); clock();
(async function(){
$('#unilist').innerHTML=UNI.map(u=>`<option value="${esc(u.t)}">${esc(u.n)}</option>`).join('');
$('#u_sec').innerHTML='<option value="">All sectors</option>'+BLOB.sec.map(s=>`<option>${esc(s)}</option>`).join('');
$('#u_sub').innerHTML='<option value="">All sub-industries</option>'+BLOB.sub.map(s=>`<option>${esc(s)}</option>`).join('');
$('#u_met').innerHTML='<option value="">No metric filter</option>'+M.map(m=>`<option value="${m.k}">${esc(m.h)}</option>`).join('');
await loadTheme();
renderBudget();
await restore();
renderQuota(); renderCmp(); renderUni();
if(!SET.length) setStatus('Enter a subject and build a comp set');
})();
</script>
</body>
</html>
Websites this page contacts when it runs — fonts, chart libraries, data. Found by reading its source.
Published on Globefin under the MIT License. You may copy, change, and reuse this page, including commercially — just keep the notice below with it.
Copyright © 2026 Shane Hadden. Licensed under the MIT License. Published on Globefin.
Provided as is, without warranty. Any external libraries it loads keep their own licences. Terms →
Scripts run, but the demo has its own throwaway origin. It can't read your session or cookies, can't reach the page around it, and can't navigate your tab. Don't enter real passwords or personal data into any demo.