MACD (Moving Average Convergence Divergence) Calculator

Enter at least 34 prices for standard 12, 26, 9 periods. More data gives more results.

MACD Calculation Results

Period Price Fast EMA () Slow EMA () MACD Line Signal Line () MACD Histogram

Signal Line Period: ${signalLinePeriodInput.value}

Calculated MACD Values

${macdResultsTbody.innerHTML}
Period Price Fast EMA (${fastEmaPeriodInput.value}) Slow EMA (${slowEmaPeriodInput.value}) MACD Line Signal Line (${signalLinePeriodInput.value}) MACD Histogram
`; element.innerHTML = pdfContent; html2pdf().from(element).set({ margin: [10, 10, 10, 10], filename: 'MACD_Calculator_Report.pdf', image: { type: 'jpeg', quality: 0.98 }, html2canvas: { scale: 2, logging: true, dpi: 192, letterRendering: true }, jsPDF: { unit: 'mm', format: 'a4', orientation: 'landscape' } /* Landscape for wider tables */ }).save(); } // Attach event listeners if (calculateButton) { calculateButton.addEventListener('click', calculateMACD); } else { console.error("Calculate button not found."); } if (downloadPdfButton) { downloadPdfButton.addEventListener('click', downloadPDF); } else { console.error("Download PDF button not found."); } });
Scroll to Top