Market Breadth Calculator

This tool calculates key market breadth metrics based on your manually entered data for a given period.

Enter Daily Market Data

Provide the number of advancing/declining stocks and their volumes for a specific day/period.

Cumulative Advance/Decline Line

To calculate the cumulative Advance/Decline Line, enter historical Net Advances for each period.
Start with the previous period's A/D Line value to continue the cumulative sum.

Net Advances = (Advancing Stocks - Declining Stocks) for each period.

Market Breadth Calculation Results

Daily Breadth Metrics

Metric Value
Advance/Decline Ratio (A/D Ratio)N/A
Advance/Decline Volume Ratio (A/D Volume Ratio)N/A
Arms Index (TRIN)N/A
Net AdvancesN/A
Net VolumeN/A

Cumulative Advance/Decline Line Series

Period Net Advances Cumulative A/D Line

Declining Stocks: ${decliningStocksInput.value || 'N/A'}

Unchanged Stocks: ${unchangedStocksInput.value || 'N/A'}

Advancing Volume: ${formatCurrency(parseFloat(advancingVolumeInput.value) || 0)}

Declining Volume: ${formatCurrency(parseFloat(decliningVolumeInput.value) || 0)}

Previous A/D Line Value: ${previousAdLineInput.value || 'N/A'}

Net Advances Series: ${netAdvancesSeriesInput.value || 'N/A'}

Calculated Metrics

Daily Breadth Metrics

Metric Value
Advance/Declining Ratio (A/D Ratio)${outputAdRatio.textContent}
Advance/Declining Volume Ratio (A/D Volume Ratio)${outputAdvDecVolRatio.textContent}
Arms Index (TRIN)${outputTrin.textContent}
Net Advances${outputNetAdvances.textContent}
Net Volume${outputNetVolume.textContent}

Cumulative Advance/Decline Line Series

${cumulativeAdTbody.innerHTML}
Period Net Advances Cumulative A/D Line
`; element.innerHTML = pdfContent; html2pdf().from(element).set({ margin: [10, 10, 10, 10], filename: 'Market_Breadth_Report.pdf', image: { type: 'jpeg', quality: 0.98 }, html2canvas: { scale: 2, logging: true, dpi: 192, letterRendering: true }, jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' } }).save(); } // Event Listeners for Tabs tabButtons.forEach((button, index) => { button.addEventListener('click', function() { // Prevent direct tab switching to 'Results' without calculation if (index === 2) { alert('Please calculate daily metrics or cumulative A/D line first to view results.'); return; } switchTab(index); }); }); // Navigation Buttons if (calculateDailyBreadthButton) { calculateDailyBreadthButton.addEventListener('click', calculateDailyMetrics); } else { console.error("Calculate Daily Breadth button not found."); } if (nextTab1Button) { nextTab1Button.addEventListener('click', function() { switchTab(1); // Go to Cumulative A/D tab }); } else { console.error("Next tab 1 button not found."); } if (prevTab2Button) { prevTab2Button.addEventListener('click', function() { switchTab(0); // Go back to Daily Data Input tab }); } else { console.error("Prev tab 2 button not found."); } if (calculateCumulativeAdButton) { calculateCumulativeAdButton.addEventListener('click', calculateCumulativeADLine); } else { console.error("Calculate Cumulative A/D button not found."); } if (prevTab3Button) { prevTab3Button.addEventListener('click', function() { // Determine which input tab to return to // Default to first input tab if no results were shown or inputs are empty if (dailyMetricsDisplay.style.display === 'block' && (advancingStocksInput.value || decliningStocksInput.value || unchangedStocksInput.value || advancingVolumeInput.value || decliningVolumeInput.value)) { switchTab(0); } else if (cumulativeAdDisplay.style.display === 'block' && (previousAdLineInput.value || netAdvancesSeriesInput.value)) { switchTab(1); } else { switchTab(0); // Fallback to first input tab } }); } else { console.error("Prev tab 3 button not found."); } if (downloadPdfButton) { downloadPdfButton.addEventListener('click', downloadPDF); } else { console.error("Download PDF button not found."); } });
Scroll to Top