Smart Money Flow Tracker

Smart Money Flow Tracker

Analyze institutional order flow for bullish or bearish signals.

Notable Bullish Flow

Notable Bearish Flow

Export Smart Money Insights Report

Generate a professional PDF of the institutional flow analysis for your records.

${t.desc}

`).join(''); }); } // --- PDF GENERATION --- async function generatePdfReport() { downloadPdfBtn.disabled = true; downloadPdfBtn.textContent = 'Generating...'; const renderTableRows = (trades) => trades.map(t => `${t.type}${t.desc}$${t.value.toLocaleString()}`).join('') || `No activity recorded.`; const reportHtml = `

Smart Money Insights Report

TICKER: ${currentTicker} | DATE: ${new Date().toLocaleDateString()}

BULLISH FLOW
$${(analysisResults.bullishFlow/1_000_000).toFixed(1)}M
BEARISH FLOW
$${(analysisResults.bearishFlow/1_000_000).toFixed(1)}M
SENTIMENT
${analysisResults.sentimentScore.toFixed(1)}%
Institutional Flow Breakdown
Notable Bullish Transactions
${renderTableRows(analysisResults.bullishTrades)}
TypeDescriptionValue
Notable Bearish Transactions
${renderTableRows(analysisResults.bearishTrades)}
TypeDescriptionValue
`; const pdfTemplate = document.getElementById('pdf-template'); pdfTemplate.innerHTML = reportHtml; pdfTemplate.classList.remove('invisible'); new Chart(document.getElementById('pdf-sentiment-chart'), { type: 'bar', data: sentimentChart.data, options: { ...sentimentChart.options, animation: { duration: 0 }, maintainAspectRatio: false } }); setTimeout(async () => { try { const { jsPDF } = window.jspdf; const canvas = await html2canvas(pdfTemplate.querySelector('.pdf-page'), { scale: 2 }); const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'p', unit: 'pt', format: 'a4' }); const pdfWidth = pdf.internal.pageSize.getWidth(), pdfHeight = (canvas.height * pdfWidth) / canvas.width; pdf.addImage(imgData, 'PNG', 0, 0, pdfWidth, pdfHeight); pdf.save(`Smart_Money_Report_${currentTicker}.pdf`); } catch (e) { console.error('PDF Generation Error:', e); } finally { downloadPdfBtn.disabled = false; downloadPdfBtn.textContent = 'Download PDF Report'; pdfTemplate.classList.add('invisible'); pdfTemplate.innerHTML = ''; } }, 500); } // --- EVENT LISTENERS --- analyzeBtn.addEventListener('click', () => { const ticker = tickerInput.value.trim().toUpperCase(); if (ticker) { currentTicker = ticker; analyzeData(); switchTab(0); } }); downloadPdfBtn.addEventListener('click', generatePdfReport); // --- INITIALIZATION --- analyzeData(); switchTab(0); });
Scroll to Top