alphaear-stock
Agent skill fromRKiding/Awesome-finance-skills
Search A-Share/HK/US finance stock tickers and retrieve finance stock price history. Use when user asks about finance stock codes, recent price changes, or specific company finance stock info.
How to install alphaear-stock
install alphaear-stock
# install the Awesome-finance-skills pack with the skills CLI
npx skills add RKiding/Awesome-finance-skills# or add only this skill to Claude Code: copy the folder
skills/alphaear-stock/
# into
~/.claude/skills/alphaear-stock/ (all projects)
.claude/skills/alphaear-stock/ (one project)
1# AlphaEar Stock Skill23## Overview45Search A-Share/HK/US stock tickers and retrieve historical price data (OHLCV).67## Capabilities89### 1. Stock Search & Data1011Use `scripts/stock_tools.py` via `StockTools`.1213- **Search**: `search_ticker(query)`14 - Fuzzy search by code or name (e.g., "Moutai", "600519").15 - Returns: List of `{code, name}`.16- **Get Price**: `get_stock_price(ticker, start_date, end_date)`17 - Returns DataFrame with OHLCV data.18 - Dates format: "YYYY-MM-DD".19- **Get Fundamentals**: `get_stock_fundamentals(ticker)`20 - Returns dict with sector, industry, market cap, PE ratio, and summary.21 - Supports A-Share/HK/US stocks.2223## Dependencies2425- `pandas`, `requests`, `akshare`, `yfinance`26- `scripts/database_manager.py` (stock tables)2728## Notes2930- **Proxy**: For US stock data (via `yfinance`), you may need to set environment variables if your network cannot reach Yahoo Finance directly:31 ```bash32 export HTTP_PROXY="http://<proxy_ip>:<port>"33 export HTTPS_PROXY="http://<proxy_ip>:<port>"34 ```35- **A-Share/HK**: Data is primarily fetched via `akshare` (EastMoney), which usually works best with a direct connection in China. The tool automatically detects proxy issues and attempts direct connection for these markets.
Excerpt shown under the repository's Apache-2.0 license.
