Synthetic Options Strategy Simulator

Synthetic Options Strategy Simulator

Please fill all fields correctly.

'; return; } let sharePnL = 0; if (sharePosition === 'long') { sharePnL = underlyingPrice - callStrike; } else { sharePnL = callStrike - underlyingPrice; } const callPnL = Math.max(0, underlyingPrice - callStrike) - callPremium; const putPnL = Math.max(0, putStrike - underlyingPrice) - putPremium; const totalPnL = sharePnL + callPnL + putPnL; document.getElementById('results').innerHTML = `

Simulation Results:

Share PnL: $${sharePnL.toFixed(2)}

Call Option PnL: $${callPnL.toFixed(2)}

Put Option PnL: $${putPnL.toFixed(2)}

Total PnL: $${totalPnL.toFixed(2)}

`; } function downloadPDF() { const { jsPDF } = window.jspdf; const doc = new jsPDF(); const resultDiv = document.getElementById('results'); if (!resultDiv.innerText.trim()) { alert('Please simulate the strategy before downloading the PDF.'); return; } doc.setFontSize(16); doc.text('Synthetic Options Strategy Results', 20, 20); doc.setFontSize(12); let y = 30; resultDiv.querySelectorAll('p').forEach(p => { doc.text(p.innerText, 20, y); y += 10; }); doc.save('synthetic-options-strategy.pdf'); }
Scroll to Top