Stock OCR for Openclaw

A specialized tool for capturing K-line screenshots from financial terminals and extracting Moving Average (MA) values through high-precision OCR.

hustjim2026
v1.0.0
Mar 30, 2026
0
662
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install stock-ocr

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install stock-ocr using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Stock OCR?

Stock OCR is an advanced automation skill designed to interface directly with financial trading terminals like TongDaxin. It bridges the gap between visual trading interfaces and actionable data by automating the process of navigating to specific stock codes, switching to daily K-line views, and performing targeted screen captures.

By leveraging various optical character recognition engines, this Openclaw Skills integration transforms pixels into structured data. It specifically targets technical indicators such as MA5, MA10, MA20, and MA60, allowing traders and developers to programmatically monitor support and resistance levels without manual data entry.

Stock OCR Use Cases

  • Automatically retrieving the MA20 value for specific stock symbols like 000001 or 600000.
  • Analyzing technical indicator positions to identify market support and pressure points.
  • Batch processing screenshots from financial terminals to extract historical moving average data.
  • Verifying trading software visuals during automated strategy execution.

How Stock OCR Works

  1. The skill identifies and targets the active financial terminal window using fuzzy title matching.
  2. It simulates keyboard input to enter the desired stock code and confirms the selection.
  3. It executes a specific shortcut command (96 + Enter) to switch the interface to the Daily K-line view.
  4. A precise crop of the top-left corner (450x100 pixels) is captured, where the MA values are typically displayed.
  5. The captured image is processed through a selected OCR engine (e.g., Baidu High-Precision, RapidOCR, or Tesseract).
  6. The raw text is parsed using regex patterns to extract and return structured numerical values for MA indicators.

Stock OCR Setup

To get started with this Openclaw Skills component, install the necessary Python dependencies and configure your preferred OCR engine:

# Install core requirements
pip install Pillow pywin32

# Optional: Install RapidOCR for offline use
pip install rapidocr-onnxruntime

# Configure Baidu High-Precision OCR (Recommended)
powershell -ExecutionPolicy Bypass -File scripts/configure_baidu_ocr.ps1 -ApiKey "your_api_key" -SecretKey "your_secret_key"

Stock OCR Data Schema & Taxonomy

The skill generates temporary image artifacts and structured console output. Data extraction is mapped as follows:

Indicator Regex Pattern Purpose
MA5 MA5[:\s]*(\d+\.?\d*) Short-term trend tracking
MA10 MA10[:\s]*(\d+\.?\d*) Momentum analysis
MA20 MA20[:\s]*(\d+\.?\d*) Monthly support/resistance
MA60 MA60[:\s]*(\d+\.?\d*) Medium-term trend baseline

All captured screenshots are saved as .bmp files with timestamps if the --keep-screenshot flag is used.

Stock OCR Advanced Features

  • Multi-Engine Support: Switch between Baidu High-Precision, RapidOCR, Windows Built-in, and Tesseract OCR.
  • Engine Comparison: Use the --compare-ocr flag to evaluate accuracy across different providers simultaneously.
  • Flexible Formatting: Supports A-shares (6 digits), HK stocks (1-5 digits), and US stocks (1-5 letters).
  • Custom Delays: Adjustable input latency via --delay to accommodate slower terminal response times.
  • Extensible Logic: Easily modify regex patterns in the extract_all_ma function to capture additional technical indicators like MACD or RSI.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*