rat-pattern-detector

Detect three-stage rat-pattern signals from quarterly holding changes and kline data.

Updated Jan 12, 2026
One-click install
npx skills add https://github.com/chinawrj/agent-skills-stock --skill rat-pattern-detector
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rat-pattern-detector
Source: https://github.com/chinawrj/agent-skills-stock/tree/main/.github/skills/rat-pattern-detector
Command: npx skills add https://github.com/chinawrj/agent-skills-stock --skill rat-pattern-detector

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandas, duckdb, akshare, and includes scripts (resource) components.

What problem does it solve?

This Skill detects a specific three-phase stock-ownership pattern ("increase → decrease → increase") by analyzing quarterly holding changes and associated K-line data to identify potential rat-pattern signals and provide diagnostic triples.

Core Features & Use Cases

  • A/B/C/D diagnostics per stock based on quarterly sequences
  • Score with bcd_score to rank candidates
  • Generates diagnostic JSON for threshold tuning and reproducibility
  • Works on candidates_hkscc.parquet and kline_daily data with pre-adjusted prices

Quick Start

Run the rat-pattern detector over your candidate list to produce candidates_rat_pattern.parquet and _diag_rat_pattern.json.

Frequently Asked Questions about rat-pattern-detector

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is a rat-pattern in stock holdings data and how does kline analysis detect it?

A rat-pattern is a specific three-phase stock-ownership sequence of increase, decrease, then increase. Detection analyzes quarterly holding changes alongside pre-adjusted kline daily data to flag potential rat-pattern signals and generate diagnostic triples.

How do I detect rat-pattern stock moves from quarterly holdings data?

You detect rat-pattern stock moves by running the detector over a candidate list to analyze quarterly holding changes against kline data. This produces a parquet file of ranked hits with A/B/C/D diagnostics and a bcd_score, plus a diagnostic JSON for tuning.

Does the rat-pattern detector require pre-adjusted or forward-adjusted kline data?

Yes, the rat-pattern detector requires pre-adjusted, also known as forward-adjusted, kline daily data. Using properly adjusted prices ensures that the quarterly holding change analysis and subsequent A/B/C/D diagnostics are calculated accurately across the three-stage pattern.

Can I configure detection thresholds for the rat-pattern analysis via CLI?

Yes, you can configure detection thresholds via CLI arguments. The detector respects these CLI-configurable thresholds during the kline and holdings analysis, and outputs a diagnostic JSON file specifically to assist with threshold tuning and ensuring reproducibility.

What is the bcd_score used for in rat-pattern stock screening?

The bcd_score is used to rank candidate stocks that exhibit the rat-pattern. It is generated alongside A/B/C/D diagnostics based on quarterly holding sequences, allowing you to prioritize the final parquet hit list for further stock analysis.