alphaear-stock

$npx mdskill add RKiding/Awesome-finance-skills/alphaear-stock

Search and retrieve stock tickers and price history for A-Share, HK, and US markets.

  • Finds stock tickers by fuzzy matching code or company name.
  • Uses akshare for A-Share/HK data and yfinance for US data.
  • Automatically selects data source based on market and detects proxy issues.
  • Returns OHLCV price data, fundamentals, or ticker list as structured data.

SKILL.md

.github/skills/alphaear-stockView on GitHub ↗
---
name: alphaear-stock
description: 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.
---

# AlphaEar Stock Skill

## Overview

Search A-Share/HK/US stock tickers and retrieve historical price data (OHLCV).

## Capabilities

### 1. Stock Search & Data

Use `scripts/stock_tools.py` via `StockTools`.

-   **Search**: `search_ticker(query)`
    -   Fuzzy search by code or name (e.g., "Moutai", "600519").
    -   Returns: List of `{code, name}`.
-   **Get Price**: `get_stock_price(ticker, start_date, end_date)`
    -   Returns DataFrame with OHLCV data.
    -   Dates format: "YYYY-MM-DD".
-   **Get Fundamentals**: `get_stock_fundamentals(ticker)`
    -   Returns dict with sector, industry, market cap, PE ratio, and summary.
    -   Supports A-Share/HK/US stocks.

## Dependencies

-   `pandas`, `requests`, `akshare`, `yfinance`
-   `scripts/database_manager.py` (stock tables)

## Notes

-   **Proxy**: For US stock data (via `yfinance`), you may need to set environment variables if your network cannot reach Yahoo Finance directly:
    ```bash
    export HTTP_PROXY="http://<proxy_ip>:<port>"
    export HTTPS_PROXY="http://<proxy_ip>:<port>"
    ```
-   **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.

More from RKiding/Awesome-finance-skills

SkillDescription
alphaear-deepear-liteFetch the latest financial signals and transmission-chain analyses from DeepEar Lite. Use when the user needs immediate insights into financial market trends, stock performance factors, and reasoning from the DeepEar Lite dashboard.
alphaear-logic-visualizerCreate visualize finance logic diagrams (e.g., Draw.io XML) to explain complex finance transmission chains or finance logic flows.
alphaear-newsFetch hot finance news, unified trends, and prediction financial market data. Use when the user needs real-time financial news, trend reports from multiple finance sources (Weibo, Zhihu, WallstreetCN, etc.), or Polymarket finance market prediction data.
alphaear-predictorMarket prediction skill using Kronos. Use when user needs finance market time-series forecasting or news-aware finance market adjustments.
alphaear-reporterPlan, write, and edit professional financial reports; generate finance chart configurations. Use when condensing finance analysis into a structured output.
alphaear-searchPerform finance web searches and local context searches. Use when the user needs general finance info from the web (Jina/DDG/Baidu) or needs to retrieve finance information from a local document store (RAG).
alphaear-sentimentAnalyze finance text sentiment using FinBERT or LLM. Use when the user needs to determine the sentiment (positive/negative/neutral) and score of financial text markets.
alphaear-signal-trackerTrack finance investment signal evolution and update logic based on new finance market information. Use when monitoring finance signals and determining if they are strengthened, weakened, or falsified.