PassedNatural language questionPerform a comprehensive analysis of a single A-share stock and return a Markdown diagnostic report. Applicable scenarios include:
- Overall judgment of an individual stock (fundamentals + capital flow + risk)
- Reference for position decisions (hold/reduce/take profit/wait and see)
- Risk screening of individual stocks under hot market conditions
- One-stop diagnostic answers for users' generalized questions
Functional Scope
Basic Diagnostic Capabilities
- Input a natural language question, call the stock diagnosis interface to generate structured conclusions
- Process onlyoneShanghai, Shenzhen, and Beijing A-share stock each time
- Return a readable Markdown report (prioritize extracting
data.displayData) - Support saving the result as a local
.mdfile for review and tracking
Trigger Rules (When to Use This Skill)
- The user's question is ageneral/broaddiagnosis: such as "How is this stock?", "Is it worth buying?", "Should I sell?"
- The question does not explicitly require calculation of a single technical indicator or financial indicator
- If the stock entity is already clear from context and the user continues to ask using pronouns such as "it/this stock", it should also trigger
Non-trigger Rules (When Not to Use This Skill)
- The user explicitly names a specific indicator calculation: MACD, KDJ, RSI, Bollinger Bands, ROE, PE, etc.
- The user requests a horizontal comparison of multiple stocks (should use multi-target analysis capabilities)
- The user asks about Hong Kong stocks, U.S. stocks, or other non-A-share markets
Trigger Examples
| Trigger (general diagnosis) | Do not trigger (indicator-specific) |
|---|---|
| How is Danhua Technology? | Has Danhua Technology's MACD formed a golden cross? |
| What should I do after losing money on Hikvision? | What is Hikvision's current P/E ratio? |
| Is Huaertai worth investing in? | Is Huaertai's RSI overbought? |
| Give a comprehensive analysis of Ping An of China | What is the ROE trend of Ping An of China? |
Quick Start
1. Command-line invocation
python3 {baseDir}/scripts/get_data.py --query "东方财富股票咋样"
Output example
Saved: /path/to/workspace/stock_diagnosis/stock_diagnosis_90bf169c.md
(随后输出 Markdown 诊断内容)
Parameter description:
| Parameter | Description | Required |
|---|---|---|
--query |
The user's original natural language question | ✅(--query or stdin, choose one) |
--no-save |
Only output the result, do not write to a local file | No |
2. Code invocation
import asyncio
from pathlib import Path
from scripts.get_data import diagnose_stock
async def main():
result = await diagnose_stock(
question="分析一下东方财富这只股票",
output_dir=Path("workspace/stock_diagnosis"),
save_to_file=True,
)
if "error" in result:
print(result["error"])
else:
print(result["content"])
if result.get("output_path"):
print("已保存至:", result["output_path"])
asyncio.run(main())
Output Specification
After obtaining the stock diagnosis result through a script or tool,the visible reply to the user must use the Markdown main text returned by the interface as the main body, avoiding the model paraphrasing it again. Only when the interface/script explicitly returns error, or the main text is empty, should a brief text explanation of the failure reason be used;ProhibitedFabricating report content when a failure occurs.
Frequently Asked Questions
Why is it necessary to keep the original question?
→ The stock diagnosis API relies on the user's natural language context; it is recommended to avoid rewording that causes semantic drift.
How can I view only the output without writing it to disk?
python3 -m scripts.get_data --query "东方财富股票咋样" --no-save
Compliance Statement
- Stock diagnosis results are for reference only and do not constitute investment advice; a risk warning should be attached when outputting.
- It is prohibited to hardcode account IDs, session IDs, or tokens in code or prompts.
- Treat environment variables as sensitive information; do not leak them in logs or replies.
- When the API fails, do not fabricate conclusions; return an explicit error or an explanation of uncertainty.