stock-analysis-plugin 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hermes/__init__.py +57 -0
- hermes/plugin.yaml +84 -0
- hermes/schemas.py +573 -0
- hermes/tools.py +229 -0
- stock_analysis_plugin-0.1.1.dist-info/METADATA +10 -0
- stock_analysis_plugin-0.1.1.dist-info/RECORD +25 -0
- stock_analysis_plugin-0.1.1.dist-info/WHEEL +4 -0
- stock_analysis_plugin-0.1.1.dist-info/entry_points.txt +2 -0
- tools/__init__.py +0 -0
- tools/anomaly_detect.py +570 -0
- tools/backtest.py +643 -0
- tools/gather.py +152 -0
- tools/market_regime.py +247 -0
- tools/market_review.py +150 -0
- tools/name_resolver.py +131 -0
- tools/pattern.py +509 -0
- tools/requirements.txt +13 -0
- tools/risk_screening.py +318 -0
- tools/screener.py +213 -0
- tools/search_intel.py +455 -0
- tools/stock_data.py +1649 -0
- tools/technical.py +636 -0
- tools/trading_calendar.py +198 -0
- tools/volume_analysis.py +172 -0
- tools/watchlist.py +61 -0
hermes/__init__.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
from . import schemas, tools
|
|
4
|
+
|
|
5
|
+
PROJECT_ROOT = Path(__file__).resolve().parent.parent
|
|
6
|
+
SKILLS_DIR = PROJECT_ROOT / "skills"
|
|
7
|
+
|
|
8
|
+
_HANDLER_MAP = {
|
|
9
|
+
"get_kline": tools.get_kline,
|
|
10
|
+
"get_quote": tools.get_quote,
|
|
11
|
+
"get_capital_flow": tools.get_capital_flow,
|
|
12
|
+
"get_news": tools.get_news,
|
|
13
|
+
"get_financials": tools.get_financials,
|
|
14
|
+
"get_technical_analysis": tools.get_technical_analysis,
|
|
15
|
+
"analyze_pattern": tools.analyze_pattern,
|
|
16
|
+
"get_market_indices": tools.get_market_indices,
|
|
17
|
+
"get_sector_rankings": tools.get_sector_rankings,
|
|
18
|
+
"get_stock_info": tools.get_stock_info,
|
|
19
|
+
"get_chip_distribution": tools.get_chip_distribution,
|
|
20
|
+
"get_market_stats": tools.get_market_stats,
|
|
21
|
+
"get_fundamental_context": tools.get_fundamental_context,
|
|
22
|
+
"screen_stocks": tools.screen_stocks,
|
|
23
|
+
"run_backtest": tools.run_backtest,
|
|
24
|
+
"evaluate_signal": tools.evaluate_signal,
|
|
25
|
+
"resolve_stock_name": tools.resolve_stock_name,
|
|
26
|
+
"check_trading_day": tools.check_trading_day,
|
|
27
|
+
"get_trading_days": tools.get_trading_days,
|
|
28
|
+
"calculate_ma": tools.calculate_ma,
|
|
29
|
+
"get_volume_analysis": tools.get_volume_analysis,
|
|
30
|
+
"search_stock_news": tools.search_stock_news,
|
|
31
|
+
"search_comprehensive_intel": tools.search_comprehensive_intel,
|
|
32
|
+
"get_social_sentiment": tools.get_social_sentiment,
|
|
33
|
+
"get_trending_sentiment": tools.get_trending_sentiment,
|
|
34
|
+
"extract_article": tools.extract_article,
|
|
35
|
+
"screen_risk": tools.screen_risk,
|
|
36
|
+
"detect_market_regime": tools.detect_market_regime,
|
|
37
|
+
"get_market_review": tools.get_market_review,
|
|
38
|
+
"run_watchlist_analysis": tools.run_watchlist_analysis,
|
|
39
|
+
"detect_anomaly": tools.detect_anomaly,
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def register(ctx):
|
|
44
|
+
for schema in schemas.TOOL_SCHEMAS:
|
|
45
|
+
name = schema["name"]
|
|
46
|
+
handler = _HANDLER_MAP[name]
|
|
47
|
+
ctx.register_tool(
|
|
48
|
+
name=name,
|
|
49
|
+
toolset="stock-analysis",
|
|
50
|
+
schema=schema,
|
|
51
|
+
handler=handler,
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
for child in sorted(SKILLS_DIR.iterdir()):
|
|
55
|
+
skill_md = child / "SKILL.md"
|
|
56
|
+
if child.is_dir() and skill_md.exists():
|
|
57
|
+
ctx.register_skill(child.name, str(skill_md))
|
hermes/plugin.yaml
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
name: stock-analysis
|
|
2
|
+
version: 0.1.0
|
|
3
|
+
description: "Stock analysis, screening, and strategy backtesting across A/HK/US markets"
|
|
4
|
+
provides_tools:
|
|
5
|
+
- get_kline
|
|
6
|
+
- get_quote
|
|
7
|
+
- get_capital_flow
|
|
8
|
+
- get_news
|
|
9
|
+
- get_financials
|
|
10
|
+
- get_technical_analysis
|
|
11
|
+
- analyze_pattern
|
|
12
|
+
- get_market_indices
|
|
13
|
+
- get_sector_rankings
|
|
14
|
+
- get_stock_info
|
|
15
|
+
- get_chip_distribution
|
|
16
|
+
- get_market_stats
|
|
17
|
+
- get_fundamental_context
|
|
18
|
+
- screen_stocks
|
|
19
|
+
- run_backtest
|
|
20
|
+
- evaluate_signal
|
|
21
|
+
- resolve_stock_name
|
|
22
|
+
- check_trading_day
|
|
23
|
+
- get_trading_days
|
|
24
|
+
- calculate_ma
|
|
25
|
+
- get_volume_analysis
|
|
26
|
+
- search_stock_news
|
|
27
|
+
- search_comprehensive_intel
|
|
28
|
+
- get_social_sentiment
|
|
29
|
+
- get_trending_sentiment
|
|
30
|
+
- extract_article
|
|
31
|
+
- screen_risk
|
|
32
|
+
- detect_market_regime
|
|
33
|
+
- get_market_review
|
|
34
|
+
- run_watchlist_analysis
|
|
35
|
+
- detect_anomaly
|
|
36
|
+
requires_env:
|
|
37
|
+
- name: TAVILY_API_KEY
|
|
38
|
+
description: "Tavily search API key (optional, one search engine is enough)"
|
|
39
|
+
url: "https://tavily.com"
|
|
40
|
+
secret: true
|
|
41
|
+
- name: BRAVE_API_KEY
|
|
42
|
+
description: "Brave search API key (optional)"
|
|
43
|
+
url: "https://brave.com/search/api/"
|
|
44
|
+
secret: true
|
|
45
|
+
- name: SERPAPI_KEY
|
|
46
|
+
description: "SerpAPI key (optional)"
|
|
47
|
+
url: "https://serpapi.com"
|
|
48
|
+
secret: true
|
|
49
|
+
- name: BOCHA_API_KEY
|
|
50
|
+
description: "Bocha AI search API key (optional)"
|
|
51
|
+
secret: true
|
|
52
|
+
- name: SENTIMENT_API_KEY
|
|
53
|
+
description: "Social sentiment API key (optional, for Eastmoney + Xueqiu)"
|
|
54
|
+
secret: true
|
|
55
|
+
- name: SENTIMENT_API_URL
|
|
56
|
+
description: "Sentiment API endpoint (default: https://api.adanos.org)"
|
|
57
|
+
secret: false
|
|
58
|
+
- name: FINNHUB_API_KEY
|
|
59
|
+
description: "Finnhub API key (US stock quotes and financials)"
|
|
60
|
+
url: "https://finnhub.io"
|
|
61
|
+
secret: true
|
|
62
|
+
- name: ALPHAVANTAGE_API_KEY
|
|
63
|
+
description: "Alpha Vantage API key (US stock klines)"
|
|
64
|
+
url: "https://www.alphavantage.co"
|
|
65
|
+
secret: true
|
|
66
|
+
- name: LONGBRIDGE_APP_KEY
|
|
67
|
+
description: "Longbridge app key (HK stock quotes)"
|
|
68
|
+
url: "https://open.longportapp.com"
|
|
69
|
+
secret: true
|
|
70
|
+
- name: LONGBRIDGE_APP_SECRET
|
|
71
|
+
description: "Longbridge app secret"
|
|
72
|
+
secret: true
|
|
73
|
+
- name: LONGBRIDGE_ACCESS_TOKEN
|
|
74
|
+
description: "Longbridge access token"
|
|
75
|
+
secret: true
|
|
76
|
+
- name: TUSHARE_TOKEN
|
|
77
|
+
description: "Tushare token (A-share enhanced data, optional)"
|
|
78
|
+
url: "https://tushare.pro"
|
|
79
|
+
secret: true
|
|
80
|
+
requires_mcp:
|
|
81
|
+
- name: wisburg-mcp-server
|
|
82
|
+
description: "Wisburg research data — institutional reports, earnings calls, filings, market daily"
|
|
83
|
+
url: "https://wisburg.com"
|
|
84
|
+
optional: true
|