Futures Market Trend Analyzer

Futures Market Trend Analyzer

Analyze historical price action with key technical indicators.

ZC Analysis

Price & Moving Averages

Relative Strength Index (RSI)

Settings & Data

Indicator Settings

Historical OHLC Data

Date O H L C

Contract: ${state.settings.ticker}
Date: ${new Date().toLocaleDateString()}

Key Indicator Summary

${createPdfKpi('Current Trend', kpis.trend, kpis.trend === 'Up' ? 'up' : kpis.trend === 'Down' ? 'down' : 'neutral')} ${createPdfKpi('RSI Value', kpis.rsi.toFixed(2))} ${createPdfKpi('RSI Condition', kpis.rsiCondition, 'neutral')} ${createPdfKpi('Volatility (ATR)', kpis.volatility.toFixed(2))}

Price Chart Analysis

Relative Strength Index (RSI)

`; const pdfTemplate = document.getElementById('pdf-template'); pdfTemplate.innerHTML = reportHtml; pdfTemplate.classList.remove('invisible'); try { const { jsPDF } = window.jspdf; const canvas = await html2canvas(pdfTemplate.querySelector('.pdf-report-container'), { scale: 2 }); const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'p', unit: 'pt', format: 'a4' }); pdf.addImage(imgData, 'PNG', 0, 0, pdf.internal.pageSize.getWidth(), (canvas.height * pdf.internal.pageSize.getWidth()) / canvas.width); pdf.save(`${state.settings.ticker.split(' ')[0]}_Market_Analysis.pdf`); } catch(e) { console.error('PDF Generation Error:', e); } finally { downloadPdfBtn.disabled = false; downloadPdfBtn.textContent = 'Download Analysis Report'; pdfTemplate.classList.add('invisible'); } } downloadPdfBtn.addEventListener('click', generatePdfReport); // --- INITIALIZATION --- generateSampleData(); populateSettingsUI(); renderDataTable(); attachDataListeners(); runAnalysis(); switchTab(0); });
Scroll to Top