Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions src/html/modals.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h3>Delete all trades?</h3>

<!-- DITM CALL CALCULATOR (Wheeler) -->
<div class="merge-overlay" id="ditm-overlay">
<div class="merge-modal" style="max-width:min(660px, calc(100vw - 24px))">
<div class="merge-modal dc-modal" style="width:min(720px, calc(100vw - 24px));max-width:none">
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:4px">
<h3 style="font-size:.95rem">DITM Call vs 100 Shares</h3>
<button onclick="closeDitmCalc()" style="background:transparent;border:none;color:var(--mu2);font-size:1.2rem;cursor:pointer;padding:2px 6px">&#10005;</button>
Expand All @@ -39,7 +39,7 @@ <h3 style="font-size:.95rem">DITM Call vs 100 Shares</h3>
<div class="field"><label>Stock Price</label><input id="dc-price" type="number" step="0.01" min="0" placeholder="107.09" oninput="ditmRecalc()"></div>
<div class="field"><label>Strike</label><input id="dc-strike" type="number" step="0.01" min="0" placeholder="75" oninput="ditmRecalc()"></div>
<div class="field"><label>Premium /sh</label><input id="dc-prem" type="number" step="0.01" min="0" placeholder="40.50" oninput="ditmRecalc()"></div>
<div class="field"><label>Expiration</label><select id="dc-expiry" onchange="ditmRecalc()"></select></div>
<div class="field"><label>Expiration</label><input id="dc-expiry" type="date" oninput="ditmRecalc()"></div>
</div>
<div id="dc-tiles" class="dc-tiles"></div>
<div id="dc-matrix"></div>
Expand Down
22 changes: 0 additions & 22 deletions src/js/tradfi/20-ditm-calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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 = ['<option value="">— pick expiry —</option>'];
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('<option value="' + iso + '">' + mon[mm] + ' ' + y + '</option>');
}
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.
Expand Down
Loading