情绪量化网页版
展开
直接复制到文本文档,把后缀改为html
<! DOCT YPE html><html lang="zh-CN"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> <title>散户情绪模型 · 操作建议 · 原公式</title> <style> * { box-sizing: border-box; font-family: system-ui, ‘Segoe UI‘, sans-serif; } body { background: #eef2f7; margin: 0; padding: 24px 16px; display: flex; justify-content: center; } .card { max-width: 1500px; width: 100%; background: white; border-radius: 32px; box-shadow: 0 12px 28px rgba(0,0,0,0.1); } .header { background: linear-gradient(135deg, #1e3a4d, #0b2a38); color: white; padding: 24px 28px; border-radius: 32px 32px 0 0; } .content { padding: 28px; } .params-grid { display: flex; flex-wrap: wrap; gap: 20px; background: #f8fafd; padding: 20px; border-radius: 28px; margin-bottom: 30px; } .param-field { flex: 1; min-width: 160px; } .param-field label { font-weight: 600; display: block; margin-bottom: 8px; color: #1e4a6e; } .param-field input { width: 100%; padding: 10px 14px; border-radius: 40px; border: 1px solid #cbdde9; } .result-area { background: #eef3fc; border-radius: 28px; padding: 16px 24px; margin-bottom: 30px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; } .score-card { background: white; padding: 12px 28px; border-radius: 32px; text-align: center; } .score-card .value { font-size: 3.2rem; font-weight: 800; color: #1f5e8e; } .psych-status { background: #fff2df; padding: 8px 18px; border-radius: 40px; font-weight: 500; } .legend { background: #f9f9fb; border-radius: 24px; padding: 16px 20px; margin-bottom: 24px; border-left: 5px solid #f5a623; } .legend h4 { margin: 0 0 8px 0; } .legend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 8px; font-size: 0.75rem; } .table-wrapper { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 24px; margin-bottom: 28px; } table { width: 100%; border-collapse: collapse; font-size: 0.85rem; } th, td { padding: 10px 12px; text-align: center; border-bottom: 1px solid #ecf3fa; vertical-align: top; } th { background: #f1f5f9; font-weight: 700; } .formula-box { background: #f0f4fa; padding: 20px 24px; border-radius: 28px; margin-top: 20px; font-family: monospace; font-size: 0.85rem; overflow-x: auto; white-space: pre-wrap; } .formula-box h3 { margin-top: 0; font-family: system-ui; } .disclaimer { background: #fee2e2; border-left: 6px solid #dc2626; padding: 16px 24px; border-radius: 24px; margin-top: 28px; color: #7f1a1a; font-size: 0.8rem; } .note { background: #fff7e5; padding: 16px; border-radius: 20px; margin-top: 24px; font-size: 0.8rem; } footer { text-align: center; font-size: 0.75rem; padding: 20px 20px 10px; color: #4b6a8a; border-top: 1px solid #e2edf7; margin-top: 16px; } .author { font-weight: 600; color: #1f5e8e; margin-top: 8px; } @media (max-width: 700px) { .score-card .value { font-size: 2.2rem; } } .hint { font-size: 0.7rem; color: #5a6e85; margin-top: 4px; } </style></head><body><div class="card"> <div class="header"> <h1>📊 散户情绪 · 痛苦麻木模型</h1> <p>包含心理状态、操作建议、原始公式 | 可自由调节参数</p> </div> <div class="content"> <div class="params-grid"> <div class="param-field"><label>📉 当前亏损 (%)</label><input type="number" id="loss" value="10.0" step="0.5"></div> <div class="param-field"><label>😶 开始麻木的亏损 xₘ (%)</label><input type="number" id="numbStart" value="15.0" step="1"></div> <div class="param-field"><label>⚡ 痛苦放大 λ (x=4%时倍数)</label><input type="number" id="lambda" value="2.0" step="0.1"></div> </div> <details style="margin-bottom: 20px;"> <summary style="cursor:pointer; background:#f0f4f9; padding:8px 18px; border-radius:40px; display:inline-block;">⚙️ 高级参数</summary> <div style="display:flex; flex-wrap:wrap; gap:18px; background:#fff; padding:20px; border-radius:28px; margin-top:15px;"> <div style="flex:1;"><label>🔚 完全麻木阈值 (%)</label><input type="number" id="numbEnd" value="35.0" step="1"></div> <div style="flex:1;"><label>🪫 最低情绪分 E_min</label><input type="number" id="minScore" value="10" step="1"><div class="hint">可调高到20~30避免过于绝望</div></div> <div style="flex:1;"><label>🎯 满分基准 Y₀ (主观痛苦)</label><input type="number" id="fullScaleY" value="0.70" step="0.01"><div class="hint">越大越钝感,0.7~0.9合适</div></div> </div> </details>
<div class="result-area"> <div class="score-card"> <div style="font-size:0.8rem;">当前情绪分数</div> <div class="value" id="currentScore">--</div> <div>/ 100</div> </div> <div class="psych-status" id="psychDesc">--</div> </div>
<div class="legend"> <h4>📌 情绪分数 → 散户心理状态 一般行为倾向</h4> <div class="legend-grid"> <div><strong>0-9分</strong> 几乎无感 / 正常心态</div> <div><strong>10-24分</strong> 深度麻木 / 躺平不动</div> <div><strong>25-39分</strong> 麻木初期 / 无奈装死</div> <div><strong>40-54分</strong> 明显不适 / 纠结焦虑</div> <div><strong>55-69分</strong> 非常难受 / 频繁盯盘</div> <div><strong>70-84分</strong> 痛苦濒临崩溃 / 易冲动</div> <div><strong>85-100分</strong> 极度恐慌 / 不计成本割肉</div> </div> <p style="margin:8px 0 0 0; font-size:0.75rem;">⭐ 亏损2%以内情绪≈0-5分 → “几乎无感”,符合真实感受。</p> </div>
<h3>📋 亏损比例 → 情绪分数 + 心理状态 + 操作建议</h3> <div class="table-wrapper"> <table id="scoreTable"> <thead> <tr><th>亏损 (%)</th><th>情绪分数</th><th>心理状态</th><th>操作建议(短期)</th><th>操作建议(中期)</th><th>操作建议(长期)</th></tr> </thead> <tbody id="tableBody"></tbody> </table> </div>
<div class="formula-box"> <h3>📐 原始数学模型</h3> <strong>1. 翻倍次数</strong><br> n = max(0, log₂(x / 0.02)) 其中 x 为亏损比例(小数),0.02=2%基准阈值。<br><br> <strong>2. 主观痛苦当量 y</strong><br> y = [1 + (λ - 1) / ln2 · ln(1 + n)] · x<br> λ 为 x=0.04 时的痛苦倍数(通常2.0~2.5)。<br><br> <strong>3. 基础情绪分数 E_base</strong><br> E_base = min(100, (y / Y₀) × 100) 其中 Y₀ 为满分基准(默认0.70,原固定0.30)。<br><br> <strong>4. 麻木修正(二次下降段)</strong><br> E_max = E_base(x_m) (在麻木起点 x_m 处的情绪分)<br> k = (E_max - E_min) / (x_M - x_m)² (曲率系数)<br> E_final = <ul> <li>当 x ≤ x_m:E_base</li> <li>当 x_m < x ≤ x_M:E_max - k·(x - x_m)²</li> <li>当 x > x_M:E_min</li> </ul> <strong>说明:</strong> 所有参数(λ, x_m, x_M, E_min, Y₀)均可通过上方控件调节。完全麻木后分数为 E_min,若觉得太低可手动调高。 </div>
<div class="disclaimer"> <strong>⚠️ 股市风险提醒 免责声明</strong><br> • 本模型及所有输出(包括情绪分数、心理状态、操作建议)均为基于行为金融学的<strong>模拟推演</strong>,不构成任何投资建议、买卖依据或收益承诺。<br> • 股票、基金等投资品种价格波动剧烈,存在本金永久损失的风险。请根据自身风险承受能力独立决策,或咨询持牌专业机构。<br> • 模型中的操作建议(短期/中期/长期)仅为一般性心理参考,不代表对具体证券的买卖时点或仓位的指引。<br> • 使用者应知晓:市场存在不可预测的黑天鹅事件,任何历史规律或情绪模型都无法保证未来结果的准确性。<br> • 本工具仅供学、研究及心理模拟使用,因参考本工具产生的任何投资盈亏,开发者与提供方不承担法律责任。<br> <strong>📢 特别警示:</strong> 当您的情绪分数持续高于70分(濒临崩溃)或低于25分(麻木躺平)时,建议暂停交易,冷静评估后再做决定。 </div>
<div class="note"> 💡 本模型结合了前景理论(损失厌恶)和心理麻木效应,适合用于投资者情绪模拟。操作建议基于经验总结,不构成投资指导。 </div> <footer> 📌 参数可任意调整 | 最低分 E_min 默认10,建议调至20~30更平滑 | 亏损0-2%情绪≈0-5分,对应“无感”<br> <span class="author">✍️ 作者:淘股吧十年保本 · 完全免费,仅供交流</span><br> © 行为金融模拟工具 · 数据仅供参考,不构成投资依据 </footer> </div></div>
<script> const BASE = 0.02; const lossInp = getElementById(‘loss‘); const startInp = getElementById(‘numbStart‘); const lambdaInp = getElementById(‘lambda‘); const endInp = getElementById(‘numbEnd‘); const minInp = getElementById(‘minScore‘); const y0Inp = getElementById(‘fullScaleY‘); const curSpan = getElementById(‘currentScore‘); const psychSpan = getElementById(‘psychDesc‘); const tableBody = getElementById(‘tableBody‘);
function computeN(x) { if (x <= BASE) return 0; return Math.log2(x / BASE); } function computeY(x, lam) { let n = computeN(x); if(n===0) return x; let f = 1 + ((lam-1)/Math.log(2))*Math.log(1+n); return f*x; } function computeEBase(y, Y0) { let raw = (y/Y0)*100; return Math.min(100, Math.max(0, raw)); } function getPsych(score) { if(score >= 85) return "💥 极度恐慌 / 崩溃 → 冲动割肉"; if(score >= 70) return "😭 痛苦濒临崩溃 / 易冲动"; if(score >= 55) return "😰 非常难受 / 频繁盯盘"; if(score >= 40) return "😖 明显不适 / 纠结焦虑"; if(score >= 25) return "😐 麻木初期 / 无奈装死"; if(score >= 10) return "😴 深度麻木 / 躺平不动"; return "😶 几乎无感 / 正常心态"; } function getAdvice(score, lossPct) { let shortTerm = "", midTerm = "", longTerm = ""; if(score >= 70) { shortTerm = "🛑 立即暂停交易,避免冲动"; midTerm = "📉 减仓至心理可承受水平"; longTerm = "📚 重新评估风险偏好"; } else if(score >= 55) { shortTerm = "⏸️ 观望,不轻易加仓或割肉"; midTerm = "📊 设定止损纪律,严格执行"; longTerm = "🧘 接受波动,降低预期"; } else if(score >= 40) { shortTerm = "🔍 检查持仓逻辑是否变化"; midTerm = "⚖️ 适度分散,控制单票仓位"; longTerm = "📈 保留底仓,等待修复"; } else if(score >= 25) { shortTerm = "😴 减少盯盘,避免情绪操作"; midTerm = "💤 定投或网格缓步摊低成本"; longTerm = "🌱 关注基本面,忽略短期波动"; } else if(score >= 10) { shortTerm = "🧊 躺平,不操作就是最好操作"; midTerm = "🗿 除非逻辑毁灭,否则不动"; longTerm = "⏳ 时间换空间,等周期回归"; } else { shortTerm = "✅ 正常交易,无需特别调整"; midTerm = "📌 按原计划执行即可"; longTerm = "🚀 保持定投或持有"; } if(lossPct < 3 score < 10) { shortTerm = "😌 几乎无影响,正常操作"; midTerm = "📈 可继续持仓或小幅加仓"; longTerm = "📊 无长期担忧"; } return { shortTerm, midTerm, longTerm }; } function computeFinal(x, lam, x_m, x_M, Emin, Y0) { let y = computeY(x, lam); let E_base = computeEBase(y, Y0); if(x_m >= x_M) return E_base; let y_m = computeY(x_m, lam); let E_max = computeEBase(y_m, Y0); if(E_max < Emin) E_max = Emin; let k = (E_max - Emin) / ((x_M - x_m)**2); if(x <= x_m) return E_base; if(x <= x_M) { let val = E_max - k*(x - x_m)**2; return Math.min(E_max, Math.max(Emin, val)); } return Emin; } function refresh() { let lossPct = parseFloat(lossInp.value)||10; let x_mPct = parseFloat(startInp.value)||15; let lam = parseFloat(lambdaInp.value)||2.0; let x_MPct = parseFloat(endInp.value)||35; let Emin = parseFloat(minInp.value)||10; let Y0 = parseFloat(y0Inp.value)||0.70; lossPct = Math.min(100,Math.max(0,lossPct)); x_mPct = Math.min(100,Math.max(0,x_mPct)); lam = Math.min(8,Math.max(0.8,lam)); x_MPct = Math.min(100,Math.max(x_mPct+0.1,x_MPct)); Emin = Math.min(100,Math.max(0,Emin)); Y0 = Math.min(1.5,Math.max(0.3,Y0)); let x = lossPct/100, x_m = x_mPct/100, x_M = x_MPct/100; let score = computeFinal(x, lam, x_m, x_M, Emin, Y0); score = Math.min(100,Math.max(0,score)); curSpan.innerText = score.toFixed(1); psychSpan.innerText = getPsych(score); let html = ‘‘; for(let p=0; p<=70; p+=2){ let xv = p/100; let s = computeFinal(xv, lam, x_m, x_M, Emin, Y0); s = Math.min(100,Math.max(0,s)); let advice = getAdvice(s, p); html += `<tr> <td>${p}%</td> <td>${s.toFixed(1)}</td> <td>${getPsych(s)}</td> <td>${advice.shortTerm}</td> <td>${advice.midTerm}</td> <td>${advice.longTerm}</td> </tr>`; } tableBody.innerHTML = html; } [lossInp, startInp, lambdaInp, endInp, minInp, y0Inp].forEach(i=>i.addEventListener(‘input‘, refresh)); refresh();</script></body></html>
可直接使用,完全免费。
仅供参考不构成投资建议。
<! DOCT YPE html><html lang="zh-CN"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> <title>散户情绪模型 · 操作建议 · 原公式</title> <style> * { box-sizing: border-box; font-family: system-ui, ‘Segoe UI‘, sans-serif; } body { background: #eef2f7; margin: 0; padding: 24px 16px; display: flex; justify-content: center; } .card { max-width: 1500px; width: 100%; background: white; border-radius: 32px; box-shadow: 0 12px 28px rgba(0,0,0,0.1); } .header { background: linear-gradient(135deg, #1e3a4d, #0b2a38); color: white; padding: 24px 28px; border-radius: 32px 32px 0 0; } .content { padding: 28px; } .params-grid { display: flex; flex-wrap: wrap; gap: 20px; background: #f8fafd; padding: 20px; border-radius: 28px; margin-bottom: 30px; } .param-field { flex: 1; min-width: 160px; } .param-field label { font-weight: 600; display: block; margin-bottom: 8px; color: #1e4a6e; } .param-field input { width: 100%; padding: 10px 14px; border-radius: 40px; border: 1px solid #cbdde9; } .result-area { background: #eef3fc; border-radius: 28px; padding: 16px 24px; margin-bottom: 30px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; } .score-card { background: white; padding: 12px 28px; border-radius: 32px; text-align: center; } .score-card .value { font-size: 3.2rem; font-weight: 800; color: #1f5e8e; } .psych-status { background: #fff2df; padding: 8px 18px; border-radius: 40px; font-weight: 500; } .legend { background: #f9f9fb; border-radius: 24px; padding: 16px 20px; margin-bottom: 24px; border-left: 5px solid #f5a623; } .legend h4 { margin: 0 0 8px 0; } .legend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 8px; font-size: 0.75rem; } .table-wrapper { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 24px; margin-bottom: 28px; } table { width: 100%; border-collapse: collapse; font-size: 0.85rem; } th, td { padding: 10px 12px; text-align: center; border-bottom: 1px solid #ecf3fa; vertical-align: top; } th { background: #f1f5f9; font-weight: 700; } .formula-box { background: #f0f4fa; padding: 20px 24px; border-radius: 28px; margin-top: 20px; font-family: monospace; font-size: 0.85rem; overflow-x: auto; white-space: pre-wrap; } .formula-box h3 { margin-top: 0; font-family: system-ui; } .disclaimer { background: #fee2e2; border-left: 6px solid #dc2626; padding: 16px 24px; border-radius: 24px; margin-top: 28px; color: #7f1a1a; font-size: 0.8rem; } .note { background: #fff7e5; padding: 16px; border-radius: 20px; margin-top: 24px; font-size: 0.8rem; } footer { text-align: center; font-size: 0.75rem; padding: 20px 20px 10px; color: #4b6a8a; border-top: 1px solid #e2edf7; margin-top: 16px; } .author { font-weight: 600; color: #1f5e8e; margin-top: 8px; } @media (max-width: 700px) { .score-card .value { font-size: 2.2rem; } } .hint { font-size: 0.7rem; color: #5a6e85; margin-top: 4px; } </style></head><body><div class="card"> <div class="header"> <h1>📊 散户情绪 · 痛苦麻木模型</h1> <p>包含心理状态、操作建议、原始公式 | 可自由调节参数</p> </div> <div class="content"> <div class="params-grid"> <div class="param-field"><label>📉 当前亏损 (%)</label><input type="number" id="loss" value="10.0" step="0.5"></div> <div class="param-field"><label>😶 开始麻木的亏损 xₘ (%)</label><input type="number" id="numbStart" value="15.0" step="1"></div> <div class="param-field"><label>⚡ 痛苦放大 λ (x=4%时倍数)</label><input type="number" id="lambda" value="2.0" step="0.1"></div> </div> <details style="margin-bottom: 20px;"> <summary style="cursor:pointer; background:#f0f4f9; padding:8px 18px; border-radius:40px; display:inline-block;">⚙️ 高级参数</summary> <div style="display:flex; flex-wrap:wrap; gap:18px; background:#fff; padding:20px; border-radius:28px; margin-top:15px;"> <div style="flex:1;"><label>🔚 完全麻木阈值 (%)</label><input type="number" id="numbEnd" value="35.0" step="1"></div> <div style="flex:1;"><label>🪫 最低情绪分 E_min</label><input type="number" id="minScore" value="10" step="1"><div class="hint">可调高到20~30避免过于绝望</div></div> <div style="flex:1;"><label>🎯 满分基准 Y₀ (主观痛苦)</label><input type="number" id="fullScaleY" value="0.70" step="0.01"><div class="hint">越大越钝感,0.7~0.9合适</div></div> </div> </details>
<div class="result-area"> <div class="score-card"> <div style="font-size:0.8rem;">当前情绪分数</div> <div class="value" id="currentScore">--</div> <div>/ 100</div> </div> <div class="psych-status" id="psychDesc">--</div> </div>
<div class="legend"> <h4>📌 情绪分数 → 散户心理状态 一般行为倾向</h4> <div class="legend-grid"> <div><strong>0-9分</strong> 几乎无感 / 正常心态</div> <div><strong>10-24分</strong> 深度麻木 / 躺平不动</div> <div><strong>25-39分</strong> 麻木初期 / 无奈装死</div> <div><strong>40-54分</strong> 明显不适 / 纠结焦虑</div> <div><strong>55-69分</strong> 非常难受 / 频繁盯盘</div> <div><strong>70-84分</strong> 痛苦濒临崩溃 / 易冲动</div> <div><strong>85-100分</strong> 极度恐慌 / 不计成本割肉</div> </div> <p style="margin:8px 0 0 0; font-size:0.75rem;">⭐ 亏损2%以内情绪≈0-5分 → “几乎无感”,符合真实感受。</p> </div>
<h3>📋 亏损比例 → 情绪分数 + 心理状态 + 操作建议</h3> <div class="table-wrapper"> <table id="scoreTable"> <thead> <tr><th>亏损 (%)</th><th>情绪分数</th><th>心理状态</th><th>操作建议(短期)</th><th>操作建议(中期)</th><th>操作建议(长期)</th></tr> </thead> <tbody id="tableBody"></tbody> </table> </div>
<div class="formula-box"> <h3>📐 原始数学模型</h3> <strong>1. 翻倍次数</strong><br> n = max(0, log₂(x / 0.02)) 其中 x 为亏损比例(小数),0.02=2%基准阈值。<br><br> <strong>2. 主观痛苦当量 y</strong><br> y = [1 + (λ - 1) / ln2 · ln(1 + n)] · x<br> λ 为 x=0.04 时的痛苦倍数(通常2.0~2.5)。<br><br> <strong>3. 基础情绪分数 E_base</strong><br> E_base = min(100, (y / Y₀) × 100) 其中 Y₀ 为满分基准(默认0.70,原固定0.30)。<br><br> <strong>4. 麻木修正(二次下降段)</strong><br> E_max = E_base(x_m) (在麻木起点 x_m 处的情绪分)<br> k = (E_max - E_min) / (x_M - x_m)² (曲率系数)<br> E_final = <ul> <li>当 x ≤ x_m:E_base</li> <li>当 x_m < x ≤ x_M:E_max - k·(x - x_m)²</li> <li>当 x > x_M:E_min</li> </ul> <strong>说明:</strong> 所有参数(λ, x_m, x_M, E_min, Y₀)均可通过上方控件调节。完全麻木后分数为 E_min,若觉得太低可手动调高。 </div>
<div class="disclaimer"> <strong>⚠️ 股市风险提醒 免责声明</strong><br> • 本模型及所有输出(包括情绪分数、心理状态、操作建议)均为基于行为金融学的<strong>模拟推演</strong>,不构成任何投资建议、买卖依据或收益承诺。<br> • 股票、基金等投资品种价格波动剧烈,存在本金永久损失的风险。请根据自身风险承受能力独立决策,或咨询持牌专业机构。<br> • 模型中的操作建议(短期/中期/长期)仅为一般性心理参考,不代表对具体证券的买卖时点或仓位的指引。<br> • 使用者应知晓:市场存在不可预测的黑天鹅事件,任何历史规律或情绪模型都无法保证未来结果的准确性。<br> • 本工具仅供学、研究及心理模拟使用,因参考本工具产生的任何投资盈亏,开发者与提供方不承担法律责任。<br> <strong>📢 特别警示:</strong> 当您的情绪分数持续高于70分(濒临崩溃)或低于25分(麻木躺平)时,建议暂停交易,冷静评估后再做决定。 </div>
<div class="note"> 💡 本模型结合了前景理论(损失厌恶)和心理麻木效应,适合用于投资者情绪模拟。操作建议基于经验总结,不构成投资指导。 </div> <footer> 📌 参数可任意调整 | 最低分 E_min 默认10,建议调至20~30更平滑 | 亏损0-2%情绪≈0-5分,对应“无感”<br> <span class="author">✍️ 作者:淘股吧十年保本 · 完全免费,仅供交流</span><br> © 行为金融模拟工具 · 数据仅供参考,不构成投资依据 </footer> </div></div>
<script> const BASE = 0.02; const lossInp = getElementById(‘loss‘); const startInp = getElementById(‘numbStart‘); const lambdaInp = getElementById(‘lambda‘); const endInp = getElementById(‘numbEnd‘); const minInp = getElementById(‘minScore‘); const y0Inp = getElementById(‘fullScaleY‘); const curSpan = getElementById(‘currentScore‘); const psychSpan = getElementById(‘psychDesc‘); const tableBody = getElementById(‘tableBody‘);
function computeN(x) { if (x <= BASE) return 0; return Math.log2(x / BASE); } function computeY(x, lam) { let n = computeN(x); if(n===0) return x; let f = 1 + ((lam-1)/Math.log(2))*Math.log(1+n); return f*x; } function computeEBase(y, Y0) { let raw = (y/Y0)*100; return Math.min(100, Math.max(0, raw)); } function getPsych(score) { if(score >= 85) return "💥 极度恐慌 / 崩溃 → 冲动割肉"; if(score >= 70) return "😭 痛苦濒临崩溃 / 易冲动"; if(score >= 55) return "😰 非常难受 / 频繁盯盘"; if(score >= 40) return "😖 明显不适 / 纠结焦虑"; if(score >= 25) return "😐 麻木初期 / 无奈装死"; if(score >= 10) return "😴 深度麻木 / 躺平不动"; return "😶 几乎无感 / 正常心态"; } function getAdvice(score, lossPct) { let shortTerm = "", midTerm = "", longTerm = ""; if(score >= 70) { shortTerm = "🛑 立即暂停交易,避免冲动"; midTerm = "📉 减仓至心理可承受水平"; longTerm = "📚 重新评估风险偏好"; } else if(score >= 55) { shortTerm = "⏸️ 观望,不轻易加仓或割肉"; midTerm = "📊 设定止损纪律,严格执行"; longTerm = "🧘 接受波动,降低预期"; } else if(score >= 40) { shortTerm = "🔍 检查持仓逻辑是否变化"; midTerm = "⚖️ 适度分散,控制单票仓位"; longTerm = "📈 保留底仓,等待修复"; } else if(score >= 25) { shortTerm = "😴 减少盯盘,避免情绪操作"; midTerm = "💤 定投或网格缓步摊低成本"; longTerm = "🌱 关注基本面,忽略短期波动"; } else if(score >= 10) { shortTerm = "🧊 躺平,不操作就是最好操作"; midTerm = "🗿 除非逻辑毁灭,否则不动"; longTerm = "⏳ 时间换空间,等周期回归"; } else { shortTerm = "✅ 正常交易,无需特别调整"; midTerm = "📌 按原计划执行即可"; longTerm = "🚀 保持定投或持有"; } if(lossPct < 3 score < 10) { shortTerm = "😌 几乎无影响,正常操作"; midTerm = "📈 可继续持仓或小幅加仓"; longTerm = "📊 无长期担忧"; } return { shortTerm, midTerm, longTerm }; } function computeFinal(x, lam, x_m, x_M, Emin, Y0) { let y = computeY(x, lam); let E_base = computeEBase(y, Y0); if(x_m >= x_M) return E_base; let y_m = computeY(x_m, lam); let E_max = computeEBase(y_m, Y0); if(E_max < Emin) E_max = Emin; let k = (E_max - Emin) / ((x_M - x_m)**2); if(x <= x_m) return E_base; if(x <= x_M) { let val = E_max - k*(x - x_m)**2; return Math.min(E_max, Math.max(Emin, val)); } return Emin; } function refresh() { let lossPct = parseFloat(lossInp.value)||10; let x_mPct = parseFloat(startInp.value)||15; let lam = parseFloat(lambdaInp.value)||2.0; let x_MPct = parseFloat(endInp.value)||35; let Emin = parseFloat(minInp.value)||10; let Y0 = parseFloat(y0Inp.value)||0.70; lossPct = Math.min(100,Math.max(0,lossPct)); x_mPct = Math.min(100,Math.max(0,x_mPct)); lam = Math.min(8,Math.max(0.8,lam)); x_MPct = Math.min(100,Math.max(x_mPct+0.1,x_MPct)); Emin = Math.min(100,Math.max(0,Emin)); Y0 = Math.min(1.5,Math.max(0.3,Y0)); let x = lossPct/100, x_m = x_mPct/100, x_M = x_MPct/100; let score = computeFinal(x, lam, x_m, x_M, Emin, Y0); score = Math.min(100,Math.max(0,score)); curSpan.innerText = score.toFixed(1); psychSpan.innerText = getPsych(score); let html = ‘‘; for(let p=0; p<=70; p+=2){ let xv = p/100; let s = computeFinal(xv, lam, x_m, x_M, Emin, Y0); s = Math.min(100,Math.max(0,s)); let advice = getAdvice(s, p); html += `<tr> <td>${p}%</td> <td>${s.toFixed(1)}</td> <td>${getPsych(s)}</td> <td>${advice.shortTerm}</td> <td>${advice.midTerm}</td> <td>${advice.longTerm}</td> </tr>`; } tableBody.innerHTML = html; } [lossInp, startInp, lambdaInp, endInp, minInp, y0Inp].forEach(i=>i.addEventListener(‘input‘, refresh)); refresh();</script></body></html>
可直接使用,完全免费。
仅供参考不构成投资建议。
主题股票:
主题概念:
声明:遵守相关法律法规,所发内容承担法律责任,倡导理性交流,远离非法证券活动,共建和谐交流环境!
