THS Advanced Analysis Skill
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:
-
Code Resolution and Market Identification: It first uses the
search_symbolstool to resolve user-provided stock names, industry names, or fuzzy codes into preciseTHSCODEs with market prefixes (e.g.,USHAfor 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. -
Multi-Market Data Retrieval: It provides methods like
market_data_cn,market_data_hk, andmarket_data_usfor batch retrieval of real-time quotes. A key feature is thequery_keyparameter, 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). -
In-Depth Sector and Index Analysis: The skill supports a complete sector analysis chain:
- Fetch sector lists with
ths_industry()andths_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_indexwith standard codes likeUSHI000001.
- Fetch sector lists with
-
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. -
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_anomalyscans 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:
THScalls are synchronous and blocking. When used in asynchronous frameworks likeFastAPIorasyncio, 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-dataskill 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 ofcountversusstart/endparameters.
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.
Related Skills
Systematically identify and evaluate the economic moats of listed companies using the Tang Shu Fang investment methodology for long-term investment analysis.
A skill that converts natural language questions into A-stock data queries and returns verifiable structured analysis conclusions, covering multi-dimensional analysis of market trends, fundamentals, and news.
An AI financial copilot by Wind, integrating financial databases and multimodal analysis to provide end-to-end support across investment research, asset allocation, risk control, quant, and report generation.
Searches for latest policies and generates GB/T 9704-2020 compliant official documents (requests or reports) in Word and PDF formats.