AI Agent Hub
Back to skills
THS Advanced Analysis Skill icon

THS Advanced Analysis Skill

Professional Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please follow the guide at https://skillhub.cn/install/skillhub.md to install @user_6b3ace61/straightflush.

About this skill

The Problem It Solves

Developers and analysts working with financial data often struggle with obtaining and consolidating real-time data across multiple markets and dimensions. You need to fetch live quotes from different exchanges for A-shares, Hong Kong stocks, US stocks, forex, and futures, perform granular analysis on sectors and indices, and run complex screens based on financial and technical indicators. Traditional data sources often feature scattered APIs, inconsistent formats, and difficulty handling high-frequency data like minute K-lines, order book depth, and auction anomalies.

How the Skill Works

The straightflush skill encapsulates complex underlying APIs into a unified, powerful data access layer. The core workflow involves:

  1. Code Resolution and Market Identification: It first uses the search_symbols tool to resolve user-provided stock names, industry names, or fuzzy codes into precise THSCODEs with market prefixes (e.g., USHA for Shanghai A-shares). The skill intelligently handles scenarios like automatic selection for a single A-share or waiting for user choice when multiple A-shares match.

  2. Multi-Market Data Retrieval: It provides methods like market_data_cn, market_data_hk, and market_data_us for batch retrieval of real-time quotes. A key feature is the query_key parameter, which allows selecting different data granularities (e.g., “基础数据”, “扩展2”, or “汇总”). However, calls must ensure market homogeneity (e.g., cannot mix Shanghai and Shenzhen A-shares in one request).

  3. In-Depth Sector and Index Analysis: The skill supports a complete sector analysis chain:

    • Fetch sector lists with ths_industry() and ths_concept().
    • View overall sector performance via market_data_block.
    • Drill down to constituent stocks using block_constituents, enabling macro-to-micro analysis.
    • For indices, directly use market_data_index with standard codes like USHI000001.
  4. Advanced Stock Screening and Queries: It integrates the Wencai natural language query interface. Using wencai_nlp, you can describe screening criteria in Chinese (e.g., “连续3年ROE大于15%,非ST”), and the skill returns a list of matching stocks along with relevant data fields.

  5. High-Frequency and Real-Time Data Processing: For intraday analysis, the skill offers methods to fetch minute K-lines (klines), intraday data (intraday_data), Level-5 order book (depth), and large order flow (big_order_flow). Additionally, call_auction_anomaly scans for anomalies during the call auction period. Note that K-line interval parameters must strictly follow the “5m” format.

Boundaries and Considerations

This skill is designed for scenarios requiring deep financial data analysis and automated trading strategy development.

  • Asynchronous Environment Limitations: THS calls are synchronous and blocking. When used in asynchronous frameworks like FastAPI or asyncio, you must execute them within a thread pool to avoid blocking the main thread.
  • Data Permissions and Rate Limits: Guest accounts may have restricted access to certain professional or real-time data. When performing batch data pulls, it's advisable to add time.sleep(0.5) between calls to prevent triggering rate limits.
  • Division of Labor with Basic Quote Skills: For simpler scenarios that only require basic daily K-lines or fund flow data for a single A-share, the ths-financial-data skill might be more lightweight. This skill specializes in intraday multi-market data, in-depth analysis, sector/index data, and complex stock screening.
  • Parameter Rigor: Be strict with market code grouping (no mixing of Shanghai and Shenzhen), K-line interval format (e.g., “5m” not “5min”), and the mutual exclusivity of count versus start/end parameters.

Use Cases

  • During A-share trading hours, actively monitoring intraday price action, order book depth, and large order flow to capture abnormal volatility opportunities.
  • When writing an industry research report, quickly obtaining performance data, constituent stocks, and leading names within Shenwan sectors for horizontal comparison.
  • Building an intraday quantitative model that requires high-frequency access to 5-minute K-lines, moving averages, and volume for specific stocks for real-time strategy backtesting.
  • During weekend market review, using Wencai's natural language interface to combine complex conditions (e.g., 'consecutive ROE growth and MACD golden cross') to efficiently screen a potential stock pool for the coming week.

Best For

  • Private fund researcher: Needs to monitor real-time market anomalies and capital flow to support intraday trading decisions.
  • Individual quantitative developer: Focuses on intraday A-share strategies and requires stable, high-frequency access to minute K-lines and order book depth data.
  • Securities industry analyst: Needs to penetrate industry index performance and constituent stock data when writing sector research reports.
  • Traditional equity investment advisor: Needs to use Wencai to quickly translate a client's vague investment logic (e.g., 'low-valuation blue chips') into a concrete list of stocks.