diff --git a/src/css/styles.css b/src/css/styles.css index 6b85aea..135b5b9 100644 --- a/src/css/styles.css +++ b/src/css/styles.css @@ -355,6 +355,8 @@ tr.lot-child.la-sol:hover > td{background:rgba(153,69,255,.08)} .merge-preview .mp-row{display:flex;justify-content:space-between;padding:3px 0} .merge-preview .mp-lbl{color:var(--mu2)}.merge-preview .mp-val{color:var(--text);font-weight:600} /* DITM call calculator */ +.dc-modal{overflow:hidden} +.dc-modal #dc-matrix{overflow-x:auto} .dc-inputs{display:grid;grid-template-columns:repeat(4,1fr);gap:12px} .dc-tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:16px 0} .dc-tiles:empty{display:none} diff --git a/src/html/modals.html b/src/html/modals.html index 809046b..2977c2a 100644 --- a/src/html/modals.html +++ b/src/html/modals.html @@ -27,7 +27,7 @@

Delete all trades?

-
+

DITM Call vs 100 Shares

@@ -39,7 +39,7 @@

DITM Call vs 100 Shares

-
+
diff --git a/src/js/tradfi/20-ditm-calc.js b/src/js/tradfi/20-ditm-calc.js index 05e1abf..03feb53 100644 --- a/src/js/tradfi/20-ditm-calc.js +++ b/src/js/tradfi/20-ditm-calc.js @@ -4,8 +4,6 @@ // ditm_call_tracker.xlsx. Pure scratchpad — nothing is saved to trades. function openDitmCalc() { - const sel = document.getElementById('dc-expiry'); - if (sel && !sel.options.length) sel.innerHTML = ditmExpiryOptions(); document.getElementById('ditm-overlay').classList.add('open'); ditmRecalc(); } @@ -14,26 +12,6 @@ function closeDitmCalc() { document.getElementById('ditm-overlay').classList.remove('open'); } -// Build the expiry dropdown: the standard monthly option expiry (3rd Friday) -// for the next 36 months, so LEAPS-style horizons are one click away. -function ditmExpiryOptions() { - const mon = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; - const now = new Date(); - const out = ['']; - for (let i = 0; i < 36; i++) { - const m = now.getMonth() + i; - const y = now.getFullYear() + Math.floor(m / 12); - const mm = ((m % 12) + 12) % 12; - const firstDow = new Date(y, mm, 1).getDay(); // 0=Sun … 6=Sat - const thirdFri = 1 + ((5 - firstDow + 7) % 7) + 14; // 3rd Friday of month - const d = new Date(y, mm, thirdFri); - if (d <= now) continue; // skip this month if already past - const iso = y + '-' + String(mm + 1).padStart(2, '0') + '-' + String(thirdFri).padStart(2, '0'); - out.push(''); - } - return out.join(''); -} - // Auto-generate a sorted, deduped set of price levels: total loss (0), // current price (stock breakeven), strike, option breakeven, plus a spread // of ± moves around the current price.