تخطَّ إلى المحتوى
TakoAPI
العودة إلى المهارات

free-a-share-real-time-data

بواسطة wangdinglu

Browser & Automation
741التنزيلات وفق ما يذكره clawskills.sh
0المشاهدات
لا إعجاباتسجّل الدخول للإعجاب بهذه المهارة
—لم يُقيَّم بعد
تقييمك

موجز

Fetch China A-share stock market data (bars, realtime quotes, tick-by-tick transactions) via mootdx/TDX protocol.

الوصف

ما الذي تفعله هذه المهارة

Wraps the mootdx library to fetch China A-share market data via the TDX protocol. Covers K-line bars, real-time quotes, and tick-by-tick transaction records for Shanghai, Shenzhen, and ChiNext markets. Includes a timezone patch that prevents silent failures when running outside Beijing trading hours.

The automatic time_frame patch prevents the silent empty-result failure that occurs when calling mootdx from servers outside the Beijing timezone, which the raw library does not handle.

متى تستخدمها

  • Fetching real-time Level-2 quotes for a watchlist of A-share stocks
  • Pulling 1-minute intraday bars for technical indicator calculation
  • Recording tick-by-tick transaction history for a specific trading date
  • Batch-fetching K-line data for multiple stocks in parallel
  • Checking live bid/ask order book depth during trading sessions

مثال على سير العمل

الإدخال

User asks: Fetch 1-minute bars for 000001.SZ on 2025-02-10 at 10:30

الوكيل
  1. 1

    Initialize Quotes client with market='std'

  2. 2

    Apply tdxpy.hq.time_frame patch to bypass trading-hour restriction

  3. 3

    Strip the .SZ suffix to convert stock code to TDX numeric format

  4. 4

    Call get_bars with frequency=7, date='20250210', time='10:30:00', filter_by_time=True

  5. 5

    Calculate start offset accounting for 240 trading minutes per day and the 11:30-13:00 lunch gap

الإخراج

List of bar dicts each containing datetime, open, high, low, close, vol, and amount for the requested period

التثبيت

clawhub install wangdinglu/free-a-share-real-time-data

شغّل أمر واجهة سطر الأوامر، أو الصق النص في Claude Code أو Cursor أو Codex أو أي وكيل برمجة تستخدمه.

الروابط