Select an index, action, and entry/exit trading-day window around announcement or close-auction implementation to inspect the empirical CAR distribution and every historical trade.
stocks
simulator
Published
January 28, 2027
SimulatorData as of 2026-11-30
Choose an index (All, LQ45, IDX30, or MSCI), an action (Addition or Deletion), and a reference anchor (Announcement (A) or Close-Auction Implementation (E_close)). Drag the entry and exit trading-day sliders to simulate entering at the close of day t_in and exiting at the close of day t_out (capturing abnormal returns vs ^JKSE across days t_in + 1 through t_out). Everything runs locally in your browser on events_panel.csv and event_daily_grid.csv.
viewof selectedIndex = Inputs.select(["All","LQ45","IDX30","MSCI"], {value:"All",label:"Index"})viewof selectedAction = Inputs.radio(["Addition","Deletion"], {value:"Addition",label:"Action"})viewof anchorMode = Inputs.radio(["Announcement (A)","Effective Close (E_close)"], {value:"Announcement (A)",label:"Reference date"})viewof entryOffset = Inputs.range([-5,10], {value:0,step:1,label:"Entry day offset t_in (enter at close of t_in)"})viewof exitOffset = Inputs.range([-4,20], {value:5,step:1,label:"Exit day offset t_out (exit at close of t_out)"})viewof dedupDomestic = Inputs.toggle({value:false,label:"Deduplicate simultaneous LQ45 + IDX30 events"})
Show code
anchorKey = anchorMode ==="Announcement (A)"?"A":"E_close"actionCode = selectedAction ==="Addition"?"ADD":"DEL"// Index daily grid by event_id -> anchor_type -> Map(t -> ar_pct)gridByEvent = {const m =newMap();for (const row of gridRaw) {if (row.anchor_type!== anchorKey) continue;let evMap = m.get(row.event_id);if (!evMap) { evMap =newMap(); m.set(row.event_id, evMap); } evMap.set(row.t, row.ar_pct); }return m;}functionquantile(arr, q) {if (arr.length===0) returnnull;const s = [...arr].sort((a, b) => a - b);const pos = (s.length-1) * q;const lo =Math.floor(pos), hi =Math.ceil(pos);return lo === hi ? s[lo] : s[lo] + (s[hi] - s[lo]) * (pos - lo);}replay = {const validWindow = exitOffset > entryOffset;const filteredEvents = eventsRaw.filter(ev => {if (selectedIndex !=="All"&& ev.index_name!== selectedIndex) returnfalse;if (ev.action!== actionCode) returnfalse;if (dedupDomestic && ev.index_name==="IDX30"&& (ev.is_dual_domestic===true|| ev.is_dual_domestic==="true")) returnfalse;returntrue; });if (!validWindow) {return { validWindow:false,trades: [],path: [],stats:null }; }const trades = [];const stepSums =newMap();for (let t = entryOffset; t <= exitOffset; t++) stepSums.set(t, []);for (const ev of filteredEvents) {const tMap = gridByEvent.get(ev.event_id);if (!tMap) continue;let sum =0;let daysHeld =0;let missing =false;const cumByT = [{ t: entryOffset,cum:0 }];for (let t = entryOffset +1; t <= exitOffset; t++) {const ar = tMap.get(t);if (ar ==null||Number.isNaN(ar)) { missing =true;break; } sum += ar; daysHeld +=1; cumByT.push({ t,cum: sum }); }if (missing || daysHeld ===0) continue;for (const pt of cumByT) { stepSums.get(pt.t).push(pt.cum); } trades.push({ticker: ev.ticker,index_name: ev.index_name,action: ev.action,review_cycle: ev.review_cycle,announce_date:String(ev.announce_date).slice(0,10),impl_close_date:String(ev.impl_close_date).slice(0,10),days_held: daysHeld,trade_car_pct: sum,vol_ratio_e: ev.vol_ratio_e }); }const cars = trades.map(d => d.trade_car_pct);const n = cars.length;const meanCar = n >0? cars.reduce((a, b) => a + b,0) / n :null;const medCar =quantile(cars,0.5);const p25 =quantile(cars,0.25);const p75 =quantile(cars,0.75);const winRate = n >0? (100* cars.filter(v => v >0).length) / n :null;const minCar = n >0?Math.min(...cars) :null;const maxCar = n >0?Math.max(...cars) :null;const path = [];for (let t = entryOffset; t <= exitOffset; t++) {const arr = stepSums.get(t) || [];if (arr.length===0) continue;const m = arr.reduce((a, b) => a + b,0) / arr.length; path.push({ t,mean_car: m,med_car:quantile(arr,0.5),p25:quantile(arr,0.25),p75:quantile(arr,0.75),n: arr.length }); } trades.sort((a, b) => b.trade_car_pct- a.trade_car_pct);return {validWindow:true, trades, path,stats: { n, meanCar, medCar, p25, p75, winRate, minCar, maxCar } };}
Show code
fmtPct = v => v ==null?"—":`${v >=0?"+":""}${v.toFixed(2)}%`!replay.validWindow?md`**Invalid window:** Set **Exit day offset** (${exitOffset}) strictly greater than **Entry day offset** (${entryOffset}).`: replay.stats.n===0?md`**No complete events** for **${selectedIndex} · ${selectedAction}** across [${entryOffset +1}, ${exitOffset}] relative to **${anchorKey}**.`:md`**${selectedIndex} · ${selectedAction}** (${anchorKey} window [${entryOffset >=0?"+":""}${entryOffset} → ${exitOffset >=0?"+":""}${exitOffset}], capturing AR on t=${entryOffset +1}..${exitOffset}): **n = ${replay.stats.n}** events · Mean CAR **${fmtPct(replay.stats.meanCar)}** · Median CAR **${fmtPct(replay.stats.medCar)}** (IQR **${fmtPct(replay.stats.p25)}** to **${fmtPct(replay.stats.p75)}**) · Positive hit rate **${replay.stats.winRate.toFixed(1)}%** · Range **${fmtPct(replay.stats.minCar)}** to **${fmtPct(replay.stats.maxCar)}**`
1. Empirical CAR distribution across matching events
Show code
replay.validWindow&& replay.stats.n>0? Plot.plot({title:`Distribution of Trade CAR vs IHSG (${selectedIndex} · ${selectedAction}, ${anchorKey} [${entryOffset} → ${exitOffset}])`,subtitle:"Gold dashed line = sample mean CAR; solid grey line = 0% (market-adjusted breakeven)",style: {background:"transparent",color:"var(--ink)",fontFamily:"Satoshi, Arial, sans-serif"},height:340,marginLeft:55,marginBottom:42,grid:true,x: {label:"Cumulative abnormal return vs IHSG (%)"},y: {label:"Number of events"},marks: [ Plot.rectY(replay.trades, Plot.binX({y:"count"}, {x:"trade_car_pct",thresholds:18,fill: actionCode ==="ADD"? teal : red,fillOpacity:0.78,tip:true })), Plot.ruleX([0], {stroke: grey,strokeWidth:1.5}), Plot.ruleX([replay.stats.meanCar], {stroke: gold,strokeWidth:2.5,strokeDasharray:"5,4"}), Plot.ruleY([0], {stroke: grid}) ] }):md``
2. Average cumulative CAR path from entry to exit
Show code
replay.validWindow&& replay.path.length>1? Plot.plot({title:`Cumulative CAR Path Across Selected Window (${anchorKey} t = ${entryOffset}..${exitOffset})`,subtitle:"Gold line = cross-sectional mean CAR; teal dashed = median; shaded band = 25th–75th percentile",style: {background:"transparent",color:"var(--ink)",fontFamily:"Satoshi, Arial, sans-serif"},height:320,marginLeft:55,marginBottom:42,grid:true,x: {label:`Trading days relative to ${anchorKey}`},y: {label:"Cumulative abnormal return (%)"},marks: [ Plot.areaY(replay.path, {x:"t",y1:"p25",y2:"p75",fill: gold,fillOpacity:0.14}), Plot.ruleY([0], {stroke: grey,strokeWidth:1.2}), Plot.ruleX([0], {stroke: grid,strokeDasharray:"3,3"}), Plot.lineY(replay.path, {x:"t",y:"mean_car",stroke: gold,strokeWidth:2.8,tip:true}), Plot.lineY(replay.path, {x:"t",y:"med_car",stroke: teal,strokeWidth:2.0,strokeDasharray:"5,4"}), Plot.dot(replay.path, {x:"t",y:"mean_car",fill: gold,r:3}) ] }):md``
3. Trade-by-trade event log
Show code
replay.validWindow&& replay.trades.length>0? Inputs.table(replay.trades, {columns: ["ticker","index_name","action","review_cycle","announce_date","impl_close_date","days_held","trade_car_pct","vol_ratio_e"],header: {ticker:"Ticker",index_name:"Index",action:"Action",review_cycle:"Review",announce_date:"Announce (A)",impl_close_date:"Impl Close (E)",days_held:"Days",trade_car_pct:"CAR (%)",vol_ratio_e:"E Vol (×60d med)" },format: {trade_car_pct: v => v ==null?"—":`${v >=0?"+":""}${v.toFixed(2)}%`,vol_ratio_e: v => v ==null?"—":`${v.toFixed(2)}×` },rows:16 }):md``
How the model works
For each verified rebalancing event \(i\) (covering LQ45, IDX30, and MSCI Indonesia Global Standard across 2021–2026), daily market-adjusted abnormal return is:
\[AR_{i,t} = r_{i,t} - r_{\text{IHSG},t}\]
where \(r_{i,t}\) uses Yahoo Finance split/dividend-adjusted closes (adjclose) and \(r_{\text{IHSG},t}\) is the daily return of ^JKSE. Selecting entry offset \(t_{\text{in}}\) and exit offset \(t_{\text{out}}\) sums \(AR_{i,t}\) over \(t \in [t_{\text{in}} + 1, t_{\text{out}}]\), matching an executable close-to-close holding period.
Limits of this simulator
Zero transaction costs and close-auction slippage: Rebalancing trades face IDX brokerage commissions, levy/VAT, the 0.1% final sales tax on equity sells, and close-auction spread/impact — especially on illiquid deletions.
Additive CAR vs. compounded BHAR: Summing daily \(AR_{i,t}\) avoids compounding noise across short windows (1–25 days) but diverges slightly from buy-and-hold abnormal returns on volatile multi-week names.
Unmatched delisted tickers & truncated tail:SRIL (1 event) and WSKT (4 events) lack Yahoo Finance .JK history, and events in November 2026 (LQ45 Nov 18 HSC and MSCI Nov 30 SAIR) drop automatically when t_out extends past the 2026-11-30 cutoff.