{
  "schemaVersion": "1.0",
  "item": {
    "slug": "stock-analysis-lianghua",
    "name": "stock-analysis-lianghua",
    "source": "tencent",
    "type": "skill",
    "category": "数据分析",
    "sourceUrl": "https://clawhub.ai/llq20133100095/stock-analysis-lianghua",
    "canonicalUrl": "https://clawhub.ai/llq20133100095/stock-analysis-lianghua",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/stock-analysis-lianghua",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=stock-analysis-lianghua",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "analyze_stock.py",
      "indicators-reference.md",
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/stock-analysis-lianghua"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/stock-analysis-lianghua",
    "agentPageUrl": "https://openagent3.xyz/skills/stock-analysis-lianghua/agent",
    "manifestUrl": "https://openagent3.xyz/skills/stock-analysis-lianghua/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/stock-analysis-lianghua/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "快速分析（独立脚本）",
        "body": "脚本位置：.cursor/skills/stock-analysis/analyze_stock.py（项目根目录也有一份副本 analyze_stock.py）\n\n当用户要求分析某只股票时，直接执行此脚本：\n\npython .cursor/skills/stock-analysis/analyze_stock.py <股票代码> [选项]"
      },
      {
        "title": "参数",
        "body": "参数说明默认值symbol (必填)股票代码，如 META, AAPL, 0700.HK, TSLA---date, -d分析日期，格式 YYYY-MM-DD今天--days, -n回看天数90--indicators, -i逗号分隔的指标列表，或 all8个核心指标"
      },
      {
        "title": "示例",
        "body": "python .cursor/skills/stock-analysis/analyze_stock.py META\npython .cursor/skills/stock-analysis/analyze_stock.py AAPL --date 2025-02-20\npython .cursor/skills/stock-analysis/analyze_stock.py 0700.HK --days 60\npython .cursor/skills/stock-analysis/analyze_stock.py TSLA -i rsi,macd,atr,close_50_sma\npython .cursor/skills/stock-analysis/analyze_stock.py NVDA -i all"
      },
      {
        "title": "数据源（多源容灾）",
        "body": "脚本按以下优先级获取数据，自动容灾切换：\n\nStooq（免费、无需API key、不限速）\nYahoo Chart API（直接 HTTP 请求）\nyfinance（Ticker.history）\n本地缓存（tradingagents/dataflows/data_cache/ 中已有的 CSV）\n\n成功获取的数据会自动缓存到 data_cache/ 目录。"
      },
      {
        "title": "报告输出内容",
        "body": "近期行情 - 最近 15 个交易日 OHLCV + 涨跌统计\n技术指标 - 每个指标的时间序列趋势\n综合分析 - 趋势判断、动量分析、波动率分析、短期信号\n指标汇总表 - 所有指标的当前值和信号判断"
      },
      {
        "title": "分析逻辑",
        "body": "脚本内置的分析逻辑对应 market_analyst.py 的 prompt：\n\n趋势判断: 基于价格与 50SMA/200SMA 的位置关系（多头/空头排列 + 金叉/死叉）\n动量分析: RSI 超买超卖（70/30 阈值）+ MACD 与信号线交叉 + 柱状图方向\n波动率: ATR 占股价比例 + 布林带位置\n短期信号: 价格与 10EMA 的关系"
      },
      {
        "title": "支持的全部指标",
        "body": "close_50_sma, close_200_sma, close_10_ema,\nmacd, macds, macdh,\nrsi,\nboll, boll_ub, boll_lb,\natr,\nvwma"
      },
      {
        "title": "依赖",
        "body": "yfinance, stockstats, pandas, requests"
      },
      {
        "title": "项目架构（LangGraph 分析师节点）",
        "body": "tradingagents/\n├── agents/analysts/           # 分析师节点\n│   ├── market_analyst.py      # 市场/技术分析\n│   ├── fundamentals_analyst.py # 基本面分析\n│   ├── news_analyst.py        # 新闻分析\n│   └── social_media_analyst.py # 社交媒体情绪分析\n├── dataflows/\n│   └── interface.py           # 数据接口（工具函数定义）\n└── graph/\n    └── trading_graph.py       # LangGraph 交易图"
      },
      {
        "title": "分析师节点结构",
        "body": "每个分析师遵循统一模式：create_xxx_analyst(llm, toolkit) -> node_function"
      },
      {
        "title": "核心模板",
        "body": "from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder\nfrom langchain_core.messages import HumanMessage\nfrom ...dataflows.interface import get_market_type\n\ndef create_xxx_analyst(llm, toolkit):\n    def xxx_analyst_node(state):\n        current_date = state[\"trade_date\"]\n        ticker = state[\"company_of_interest\"]\n        market_type = get_market_type()  # \"CN\" 或 \"US\"\n\n        # 1. 根据 market_type 设置 system_message 和 tools\n        if market_type == \"CN\":\n            system_message = \"...\"\n            tools = [toolkit.cn_tool_1, toolkit.cn_tool_2]\n        else:\n            system_message = \"...\"\n            if toolkit.config[\"online_tools\"]:\n                tools = [toolkit.online_tool]\n            else:\n                tools = [toolkit.offline_tool_1, toolkit.offline_tool_2]\n\n        # 2. 构建 prompt（CN/US 可分别定义或共用）\n        prompt = ChatPromptTemplate.from_messages([\n            (\"system\",\n             \"你是一个有帮助的AI助手，与其他助手协作完成任务。\"\n             \"使用提供的工具来推进回答问题。如果你无法完全回答，没关系；\"\n             \"其他拥有不同工具的助手会在你停下的地方继续帮忙。\"\n             \"你可以使用以下工具：{tool_names}\\n{system_message}\"\n             \"供参考，当前日期是 {current_date}。我们正在分析的公司是 {ticker}\"),\n            MessagesPlaceholder(variable_name=\"messages\"),\n        ])\n        prompt = prompt.partial(\n            system_message=system_message,\n            tool_names=\", \".join([t.name for t in tools]),\n            current_date=current_date,\n            ticker=ticker,\n        )\n\n        # 3. 调用 LLM\n        chain = prompt | llm.bind_tools(tools)\n        messages = state[\"messages\"].copy()\n\n        # 工具调用次数限制（防止无限循环）\n        tool_call_count = sum(\n            1 for msg in messages\n            if hasattr(msg, 'tool_calls') and msg.tool_calls\n        )\n        if tool_call_count >= 3:\n            final_prompt = ChatPromptTemplate.from_messages([\n                (\"system\", system_message + \"\\n\\n重要提醒：请基于已获取的信息生成最终报告，不要再调用任何工具。\"),\n                MessagesPlaceholder(variable_name=\"messages\"),\n            ])\n            result = (final_prompt | llm).invoke(messages)\n        else:\n            if not (messages and getattr(messages[-1], \"role\", None) == \"user\"):\n                messages.append(HumanMessage(content=f\"请分析{ticker}的相关信息，并调用相关工具获取数据。\"))\n            result = chain.invoke(messages)\n\n        # 4. 返回结果（key 与 state schema 对应）\n        return {\n            \"messages\": [result],\n            \"xxx_report\": result.content,\n        }\n\n    return xxx_analyst_node"
      },
      {
        "title": "State 返回字段映射",
        "body": "分析师返回 key说明market_analystmarket_report技术指标与趋势分析fundamentals_analystfundamentals_report财务与基本面分析news_analystnews_report新闻与公告分析social_media_analystsentiment_report社交媒体情绪分析"
      },
      {
        "title": "可用技术指标（市场分析师）",
        "body": "指标名称必须与以下精确匹配，否则工具调用会失败：\n\n类别指标说明移动平均线close_50_sma50日简单移动平均线close_200_sma200日简单移动平均线close_10_ema10日指数移动平均线MACDmacdMACD 值macdsMACD 信号线macdhMACD 柱状图动量rsi相对强弱指数波动率boll / boll_ub / boll_lb布林带（中/上/下轨）atr平均真实波幅成交量vwma成交量加权移动平均线\n\n选择指标时最多 8 个，避免冗余（如不要同时选 rsi 和 stochrsi）。"
      },
      {
        "title": "数据工具对照表",
        "body": "分析师A股(CN)工具美股(US)在线工具美股离线工具市场分析get_akshare_data / get_akshare_data_onlineget_YFin_data_onlineget_YFin_dataget_stockstats_indicators_report / _onlineget_stockstats_indicators_report_onlineget_stockstats_indicators_report基本面get_akshare_balance_sheetget_fundamentals_openaiget_simfin_* / get_finnhub_*get_akshare_cashflow / income_stmt / finance_analysisget_akshare_special_data新闻get_company_news / get_market_newsget_global_news_openai / get_google_newsget_finnhub_news / get_reddit_news / get_google_news社交媒体get_xueqiu_stock_infoget_stock_news_openaiget_reddit_stock_info / get_finnhub_news\n\n工具函数定义在 tradingagents/dataflows/interface.py。"
      },
      {
        "title": "市场类型配置",
        "body": "通过 get_market_type() 获取，返回 \"CN\" 或 \"US\"。配置来源于 tradingagents/dataflows/config.py。"
      },
      {
        "title": "新增技术指标",
        "body": "在 interface.py 的 stockstats 工具中添加指标定义\n在 market_analyst.py 的 system_message 中添加指标描述\n指标名需与 stockstats 库一致"
      },
      {
        "title": "新增分析师类型",
        "body": "在 tradingagents/agents/analysts/ 创建新文件\n遵循上方核心模板\n在 trading_graph.py 中注册新节点\n返回值 key 需在 state schema 中定义"
      },
      {
        "title": "修改报告格式",
        "body": "所有分析师 system_message 末尾已要求附加 Markdown 表格总结。如需修改格式，调整 system_message 的指令即可。"
      },
      {
        "title": "注意事项",
        "body": "工具调用上限默认 3 次，超出后强制生成报告（防死循环）\nonline_tools 配置决定使用在线/离线数据源\n所有分析师输出中文，system_message 统一用中文编写\n报告末尾需附 Markdown 表格，方便前端展示"
      }
    ],
    "body": "股票分析 Skill\n快速分析（独立脚本）\n\n脚本位置：.cursor/skills/stock-analysis/analyze_stock.py（项目根目录也有一份副本 analyze_stock.py）\n\n当用户要求分析某只股票时，直接执行此脚本：\n\npython .cursor/skills/stock-analysis/analyze_stock.py <股票代码> [选项]\n\n参数\n参数\t说明\t默认值\nsymbol (必填)\t股票代码，如 META, AAPL, 0700.HK, TSLA\t-\n--date, -d\t分析日期，格式 YYYY-MM-DD\t今天\n--days, -n\t回看天数\t90\n--indicators, -i\t逗号分隔的指标列表，或 all\t8个核心指标\n示例\npython .cursor/skills/stock-analysis/analyze_stock.py META\npython .cursor/skills/stock-analysis/analyze_stock.py AAPL --date 2025-02-20\npython .cursor/skills/stock-analysis/analyze_stock.py 0700.HK --days 60\npython .cursor/skills/stock-analysis/analyze_stock.py TSLA -i rsi,macd,atr,close_50_sma\npython .cursor/skills/stock-analysis/analyze_stock.py NVDA -i all\n\n数据源（多源容灾）\n\n脚本按以下优先级获取数据，自动容灾切换：\n\nStooq（免费、无需API key、不限速）\nYahoo Chart API（直接 HTTP 请求）\nyfinance（Ticker.history）\n本地缓存（tradingagents/dataflows/data_cache/ 中已有的 CSV）\n\n成功获取的数据会自动缓存到 data_cache/ 目录。\n\n报告输出内容\n近期行情 - 最近 15 个交易日 OHLCV + 涨跌统计\n技术指标 - 每个指标的时间序列趋势\n综合分析 - 趋势判断、动量分析、波动率分析、短期信号\n指标汇总表 - 所有指标的当前值和信号判断\n分析逻辑\n\n脚本内置的分析逻辑对应 market_analyst.py 的 prompt：\n\n趋势判断: 基于价格与 50SMA/200SMA 的位置关系（多头/空头排列 + 金叉/死叉）\n动量分析: RSI 超买超卖（70/30 阈值）+ MACD 与信号线交叉 + 柱状图方向\n波动率: ATR 占股价比例 + 布林带位置\n短期信号: 价格与 10EMA 的关系\n支持的全部指标\nclose_50_sma, close_200_sma, close_10_ema,\nmacd, macds, macdh,\nrsi,\nboll, boll_ub, boll_lb,\natr,\nvwma\n\n依赖\nyfinance, stockstats, pandas, requests\n\n项目架构（LangGraph 分析师节点）\ntradingagents/\n├── agents/analysts/           # 分析师节点\n│   ├── market_analyst.py      # 市场/技术分析\n│   ├── fundamentals_analyst.py # 基本面分析\n│   ├── news_analyst.py        # 新闻分析\n│   └── social_media_analyst.py # 社交媒体情绪分析\n├── dataflows/\n│   └── interface.py           # 数据接口（工具函数定义）\n└── graph/\n    └── trading_graph.py       # LangGraph 交易图\n\n分析师节点结构\n\n每个分析师遵循统一模式：create_xxx_analyst(llm, toolkit) -> node_function\n\n核心模板\nfrom langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder\nfrom langchain_core.messages import HumanMessage\nfrom ...dataflows.interface import get_market_type\n\ndef create_xxx_analyst(llm, toolkit):\n    def xxx_analyst_node(state):\n        current_date = state[\"trade_date\"]\n        ticker = state[\"company_of_interest\"]\n        market_type = get_market_type()  # \"CN\" 或 \"US\"\n\n        # 1. 根据 market_type 设置 system_message 和 tools\n        if market_type == \"CN\":\n            system_message = \"...\"\n            tools = [toolkit.cn_tool_1, toolkit.cn_tool_2]\n        else:\n            system_message = \"...\"\n            if toolkit.config[\"online_tools\"]:\n                tools = [toolkit.online_tool]\n            else:\n                tools = [toolkit.offline_tool_1, toolkit.offline_tool_2]\n\n        # 2. 构建 prompt（CN/US 可分别定义或共用）\n        prompt = ChatPromptTemplate.from_messages([\n            (\"system\",\n             \"你是一个有帮助的AI助手，与其他助手协作完成任务。\"\n             \"使用提供的工具来推进回答问题。如果你无法完全回答，没关系；\"\n             \"其他拥有不同工具的助手会在你停下的地方继续帮忙。\"\n             \"你可以使用以下工具：{tool_names}\\n{system_message}\"\n             \"供参考，当前日期是 {current_date}。我们正在分析的公司是 {ticker}\"),\n            MessagesPlaceholder(variable_name=\"messages\"),\n        ])\n        prompt = prompt.partial(\n            system_message=system_message,\n            tool_names=\", \".join([t.name for t in tools]),\n            current_date=current_date,\n            ticker=ticker,\n        )\n\n        # 3. 调用 LLM\n        chain = prompt | llm.bind_tools(tools)\n        messages = state[\"messages\"].copy()\n\n        # 工具调用次数限制（防止无限循环）\n        tool_call_count = sum(\n            1 for msg in messages\n            if hasattr(msg, 'tool_calls') and msg.tool_calls\n        )\n        if tool_call_count >= 3:\n            final_prompt = ChatPromptTemplate.from_messages([\n                (\"system\", system_message + \"\\n\\n重要提醒：请基于已获取的信息生成最终报告，不要再调用任何工具。\"),\n                MessagesPlaceholder(variable_name=\"messages\"),\n            ])\n            result = (final_prompt | llm).invoke(messages)\n        else:\n            if not (messages and getattr(messages[-1], \"role\", None) == \"user\"):\n                messages.append(HumanMessage(content=f\"请分析{ticker}的相关信息，并调用相关工具获取数据。\"))\n            result = chain.invoke(messages)\n\n        # 4. 返回结果（key 与 state schema 对应）\n        return {\n            \"messages\": [result],\n            \"xxx_report\": result.content,\n        }\n\n    return xxx_analyst_node\n\nState 返回字段映射\n分析师\t返回 key\t说明\nmarket_analyst\tmarket_report\t技术指标与趋势分析\nfundamentals_analyst\tfundamentals_report\t财务与基本面分析\nnews_analyst\tnews_report\t新闻与公告分析\nsocial_media_analyst\tsentiment_report\t社交媒体情绪分析\n可用技术指标（市场分析师）\n\n指标名称必须与以下精确匹配，否则工具调用会失败：\n\n类别\t指标\t说明\n移动平均线\tclose_50_sma\t50日简单移动平均线\n\tclose_200_sma\t200日简单移动平均线\n\tclose_10_ema\t10日指数移动平均线\nMACD\tmacd\tMACD 值\n\tmacds\tMACD 信号线\n\tmacdh\tMACD 柱状图\n动量\trsi\t相对强弱指数\n波动率\tboll / boll_ub / boll_lb\t布林带（中/上/下轨）\n\tatr\t平均真实波幅\n成交量\tvwma\t成交量加权移动平均线\n\n选择指标时最多 8 个，避免冗余（如不要同时选 rsi 和 stochrsi）。\n\n数据工具对照表\n分析师\tA股(CN)工具\t美股(US)在线工具\t美股离线工具\n市场分析\tget_akshare_data / get_akshare_data_online\tget_YFin_data_online\tget_YFin_data\n\tget_stockstats_indicators_report / _online\tget_stockstats_indicators_report_online\tget_stockstats_indicators_report\n基本面\tget_akshare_balance_sheet\tget_fundamentals_openai\tget_simfin_* / get_finnhub_*\n\tget_akshare_cashflow / income_stmt / finance_analysis\t\t\n\tget_akshare_special_data\t\t\n新闻\tget_company_news / get_market_news\tget_global_news_openai / get_google_news\tget_finnhub_news / get_reddit_news / get_google_news\n社交媒体\tget_xueqiu_stock_info\tget_stock_news_openai\tget_reddit_stock_info / get_finnhub_news\n\n工具函数定义在 tradingagents/dataflows/interface.py。\n\n市场类型配置\n\n通过 get_market_type() 获取，返回 \"CN\" 或 \"US\"。配置来源于 tradingagents/dataflows/config.py。\n\n修改指南\n新增技术指标\n在 interface.py 的 stockstats 工具中添加指标定义\n在 market_analyst.py 的 system_message 中添加指标描述\n指标名需与 stockstats 库一致\n新增分析师类型\n在 tradingagents/agents/analysts/ 创建新文件\n遵循上方核心模板\n在 trading_graph.py 中注册新节点\n返回值 key 需在 state schema 中定义\n修改报告格式\n\n所有分析师 system_message 末尾已要求附加 Markdown 表格总结。如需修改格式，调整 system_message 的指令即可。\n\n注意事项\n工具调用上限默认 3 次，超出后强制生成报告（防死循环）\nonline_tools 配置决定使用在线/离线数据源\n所有分析师输出中文，system_message 统一用中文编写\n报告末尾需附 Markdown 表格，方便前端展示"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/llq20133100095/stock-analysis-lianghua",
    "publisherUrl": "https://clawhub.ai/llq20133100095/stock-analysis-lianghua",
    "owner": "llq20133100095",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/stock-analysis-lianghua",
    "downloadUrl": "https://openagent3.xyz/downloads/stock-analysis-lianghua",
    "agentUrl": "https://openagent3.xyz/skills/stock-analysis-lianghua/agent",
    "manifestUrl": "https://openagent3.xyz/skills/stock-analysis-lianghua/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/stock-analysis-lianghua/agent.md"
  }
}