股海雷达

专业技术分析工具

你好!我是股海雷达 📈

专业的技术分析工具,用数据照亮投资之路。

我可以帮助你:

次新股炒作分析 底部形态识别 洗盘形态分析 K线形态识别 多周期综合分析 技术面综合评分

点击上方"快捷功能"或输入 /帮助 了解更多!

支持上传:PDF、Word、TXT、图片 | 粘贴图片 Ctrl+V

Enter 发送 | Ctrl+Enter 换行

分析结果

AI分析结果将自动结构化显示在这里

支持技术面评分、形态识别、风险提示等

使用提示

  • • 输入 /帮助 查看所有功能
  • • 输入 /次新股分析 分析次新股
  • • 输入 /底部识别 识别底部形态
  • • 粘贴K线图或上传文件进行分析

快捷指令

/次新股分析 分析次新股炒作程度
/底部识别 识别底部形态
/洗盘分析 分析洗盘形态
/K线形态 识别K线形态
/多周期分析 日线周线月线分析
/综合评分 技术面综合评分
/帮助 查看所有功能

风险提示

  • • 本分析基于历史数据,不构成投资建议
  • • 技术面分析有局限性,需结合基本面判断
  • • 股市有风险,投资需谨慎
`); printWindow.document.close(); printWindow.print(); } // 加载 html2pdf 库 let html2pdfLoaded = false; async function loadHtml2Pdf() { if (html2pdfLoaded) return; return new Promise((resolve, reject) => { const script = document.createElement('script'); script.src = 'https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js'; script.onload = () => { html2pdfLoaded = true; resolve(); }; script.onerror = reject; document.head.appendChild(script); }); } async function exportPDF() { try { // 检查是否有内容可导出 if (!lastAIResponse) { alert('暂无内容可导出,请先进行对话获取结果'); return; } // 获取当前显示的结构化内容 const resultDiv = document.getElementById('structured-result'); const structuredContent = resultDiv.innerHTML; // 一站式导出:弹出选择对话框,支持选择目录和格式 await exportWithFilePicker(structuredContent); } catch (error) { console.error('导出失败:', error); alert('导出失败,请重试'); } } // 一站式导出:选择目录和格式 async function exportWithFilePicker(content) { // 检测浏览器支持的特性 const supportsFilePicker = 'showSaveFilePicker' in window; if (supportsFilePicker) { try { // 使用 File System Access API const handle = await window.showSaveFilePicker({ suggestedName: `股海雷达分析报告_${new Date().toISOString().slice(0, 10)}`, types: [ { description: 'PDF 文件', accept: { 'application/pdf': ['.pdf'] } }, { description: 'HTML 文件', accept: { 'text/html': ['.html'] } } ] }); // 根据选择的文件扩展名确定格式 const fileName = handle.name; const isPDF = fileName.endsWith('.pdf'); if (isPDF) { await exportAsPDFToHandle(content, handle); } else { await exportAsHTMLToHandle(content, handle); } alert('导出成功!'); } catch (err) { // 用户取消选择 if (err.name === 'AbortError') { return; } console.error('导出失败:', err); // 降级到传统下载 await fallbackExport(content); } } else { // 浏览器不支持 File System Access API,使用传统方式 await fallbackExport(content); } } // 降级导出方案(传统下载) async function fallbackExport(content) { const choice = prompt('请选择导出格式:\n1 - PDF\n2 - HTML\n请输入数字 (1 或 2):', '1'); if (choice === '1') { await exportAsPDF(content); } else if (choice === '2') { await exportAsHTML(content); } } // 导出PDF到指定句柄 async function exportAsPDFToHandle(content, handle) { await loadHtml2Pdf(); // 创建临时容器(使用浅色主题) const tempDiv = document.createElement('div'); tempDiv.innerHTML = `

股海雷达 - 技术分析报告

导出时间:${new Date().toLocaleString('zh-CN')}


${content}
`; tempDiv.style.position = 'absolute'; tempDiv.style.left = '-9999px'; document.body.appendChild(tempDiv); const opt = { margin: 10, image: { type: 'jpeg', quality: 0.98 }, html2canvas: { scale: 2, useCORS: true }, jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' } }; try { const pdfBlob = await html2pdf().set(opt).from(tempDiv).output('blob'); const writable = await handle.createWritable(); await writable.write(pdfBlob); await writable.close(); } finally { document.body.removeChild(tempDiv); } } // 导出HTML到指定句柄 async function exportAsHTMLToHandle(content, handle) { const htmlContent = generateHTMLContent(content); const blob = new Blob([htmlContent], { type: 'text/html;charset=utf-8' }); const writable = await handle.createWritable(); await writable.write(blob); await writable.close(); } // 生成HTML内容(浅色主题) function generateHTMLContent(content) { return ` 股海雷达 - 技术分析报告

股海雷达 - 技术分析报告

导出时间:${new Date().toLocaleString('zh-CN')}


${content} `; } // 导出为 PDF(降级方案) async function exportAsPDF(content) { await loadHtml2Pdf(); // 创建临时容器(浅色主题) const tempDiv = document.createElement('div'); tempDiv.innerHTML = `

股海雷达 - 技术分析报告

导出时间:${new Date().toLocaleString('zh-CN')}


${content}
`; tempDiv.style.position = 'absolute'; tempDiv.style.left = '-9999px'; document.body.appendChild(tempDiv); const opt = { margin: 10, filename: `股海雷达分析报告_${new Date().toISOString().slice(0, 10)}.pdf`, image: { type: 'jpeg', quality: 0.98 }, html2canvas: { scale: 2, useCORS: true }, jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' } }; try { await html2pdf().set(opt).from(tempDiv).save(); } finally { document.body.removeChild(tempDiv); } } // 导出为 HTML(降级方案) async function exportAsHTML(content) { const htmlContent = generateHTMLContent(content); const blob = new Blob([htmlContent], { type: 'text/html;charset=utf-8' }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `股海雷达分析报告_${new Date().toISOString().slice(0, 10)}.html`; document.body.appendChild(a); a.click(); document.body.removeChild(a); URL.revokeObjectURL(url); } // 降级下载方案 function fallbackDownload(blob, format) { const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `股海雷达分析报告_${new Date().toISOString().slice(0, 10)}.${format}`; document.body.appendChild(a); a.click(); document.body.removeChild(a); URL.revokeObjectURL(url); } function handleKeyPress(event) { if (event.key === 'Enter') { // Ctrl+Enter 换行(在光标位置插入换行符) if (event.ctrlKey) { event.preventDefault(); const input = document.getElementById('message-input'); const start = input.selectionStart; const end = input.selectionEnd; const value = input.value; // 在光标位置插入换行符,保留原有内容 input.value = value.substring(0, start) + '\n' + value.substring(end); // 将光标移动到换行符之后(即新行的开头) input.selectionStart = input.selectionEnd = start + 1; // 重新调整高度并聚焦 autoResize(input); input.focus(); } else { // 单独 Enter 发送消息 event.preventDefault(); sendMessage(); } } } function autoResize(textarea) { textarea.style.height = 'auto'; textarea.style.height = Math.min(textarea.scrollHeight, 150) + 'px'; } function scrollToBottom() { const messagesDiv = document.getElementById('chat-messages'); messagesDiv.scrollTop = messagesDiv.scrollHeight; } function escapeHtml(text) { const div = document.createElement('div'); div.textContent = text; return div.innerHTML; }