Neural Network Market Trend Predictor
Market Data Input
Sentiment & Economic Factors
Prediction Parameters (Relative Importance Weights)
40%
30%
30%
Weights will be normalized if they don't sum to 100.
Simulated Market Trend Prediction
Please complete all input tabs and click "Predict Market Trend".
Predicted Trend: ${predictedTrend}
Estimated Confidence: ${nnmtp_formatNumber(nnmtp_predictionData.results.confidence, 1)}%
`; trendViz.innerHTML = `${trendArrow}`; dlButton.style.display = 'block'; resTabLink.disabled = false; resTabLink.click(); } } window.nnmtp_downloadPDF = function() { const { jsPDF } = window.jspdf; if (!jsPDF || !nnmtp_predictionData.inputs || Object.keys(nnmtp_predictionData.inputs).length === 0) { alert("PDF library not loaded or no data to export. Please predict first."); return; } const doc = new jsPDF(); let yPos = 20; const lineHeight = 7; const indent = 5; const pageMargin = 15; const pageWidth = doc.internal.pageSize.getWidth(); const usableWidth = pageWidth - 2 * pageMargin; doc.setFontSize(18); doc.setTextColor(130, 170, 255); // #82aaff doc.text("Simulated Market Trend Prediction Report", pageWidth / 2, yPos, { align: 'center' }); yPos += lineHeight * 2.5; function addSection(title, dataObj) { if (yPos > doc.internal.pageSize.getHeight() - pageMargin - 30) { doc.addPage(); yPos = pageMargin; } doc.setFontSize(13); doc.setFont(undefined, 'bold'); doc.setTextColor(156, 191, 255); // #9cbfff doc.text(title, pageMargin, yPos); yPos += lineHeight * 1.5; doc.setFontSize(10); doc.setFont(undefined, 'normal'); doc.setTextColor(224,224,224); // #e0e0e0 for (const [key, value] of Object.entries(dataObj)) { if (yPos > doc.internal.pageSize.getHeight() - pageMargin - lineHeight) { doc.addPage(); yPos = pageMargin; } let formattedKey = key.replace(/([A-Z])/g, ' $1').replace(/^./, str => str.toUpperCase()); let valStr = String(value); if (typeof value === 'number') { if (key.toLowerCase().includes('price')) { valStr = nnmtp_formatCurrency(value); } else if (key.toLowerCase().includes('weight') || key.toLowerCase().includes('confidence')) { valStr = nnmtp_formatNumber(value, 1) + '%'; } else { valStr = nnmtp_formatNumber(value, 2); } } doc.text(`${formattedKey}:`, pageMargin + indent, yPos); doc.text(valStr, pageMargin + indent + 75, yPos, {align: 'left', maxWidth: usableWidth - (indent + 75)}); yPos += lineHeight * 1.1; } yPos += lineHeight * 0.5; } const inputSummaryForPdf = { "Asset Name": nnmtp_predictionData.inputs.assetName, "Current Price": nnmtp_predictionData.inputs.currentPrice, "Recent Price Trend": nnmtp_predictionData.inputs.priceTrendText, "Trading Volume Trend": nnmtp_predictionData.inputs.volumeTrendText, "Market Volatility": nnmtp_predictionData.inputs.volatilityText, "News Sentiment": nnmtp_predictionData.inputs.newsSentimentText, "Social Media Sentiment": nnmtp_predictionData.inputs.socialSentimentText, "GDP Growth Outlook": nnmtp_predictionData.inputs.gdpOutlookText, "Interest Rate Trend": nnmtp_predictionData.inputs.interestRateText, "Market Data Weight": nnmtp_predictionData.inputs.weightMarket, "Sentiment Weight": nnmtp_predictionData.inputs.weightSentiment, "Economic Factors Weight": nnmtp_predictionData.inputs.weightEconomic, "Prediction Time Horizon": nnmtp_predictionData.results.timeHorizon }; addSection("Input Parameters & Settings", inputSummaryForPdf); const resultsSummaryForPdf = { "Overall Score (Simulated)": nnmtp_predictionData.results.overallScore, "Predicted Trend": nnmtp_predictionData.results.predictedTrend, "Estimated Confidence": nnmtp_predictionData.results.confidence }; addSection("Prediction Outcome", resultsSummaryForPdf); doc.save(`${nnmtp_predictionData.inputs.assetName.replace(/[^a-z0-9]/gi, '_') || 'Market'}_Trend_Prediction.pdf`); }