Qmt Bridge Kline Backfill logo

Qmt Bridge Kline Backfill

Community
atorber
qmt-bridge-kline-backfill

校验近N个交易日两市成交额(上证+深证)是否可用于复盘。默认仅用 get_full_tick 写当日 与本地日缓存,不拉历史 K 线。用户提到补齐K线、近3日量能缺失、复盘前校验时使用。

Overview

Publisheratorber
Repositoryqmt-trading-skill
Skill nameqmt-bridge-kline-backfill
Stars
27
Forks
7
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by atorber on GitHub. Read the source before you install it.

Installation

Install the Qmt Bridge Kline Backfill AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/atorber/qmt-trading-skill/tree/main/skills/qmt-bridge-kline-backfill
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/atorber/qmt-trading-skill.git /tmp/qmt-trading-skill
mkdir -p .claude/skills
cp -r /tmp/qmt-trading-skill/skills/qmt-bridge-kline-backfill .claude/skills/qmt-bridge-kline-backfill
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Qmt Bridge Kline Backfill in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Qmt Bridge Kline Backfill on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Qmt Bridge Kline Backfill is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

QMT Trading Skill · 近3日量能校验

实现状态:✅ index_turnover_recent.py · backfill_recent_index_kline.py
共享逻辑:_shared/market_turnover_util.py

目标

在执行复盘前,校验近 N 日(默认 3)两市成交额是否齐全:

  • 上证指数:000001.SH
  • 深市指数:399106.SZ(tick 缺 amount 时回退 399001.SZ)

官方推荐 vs 本项目策略

迅投知识库(指数数据):

场景官方 API本项目复盘热路径
当日成交额get_full_tick → amount✅ GET /api/market/full_tick
历史指数日 Kdownload_history_data + get_market_data_ex❌ 禁用(易 BSON 崩溃)
历史缺口需本地已下载数据✅ reports/market_turnover_daily.json 每日 tick 累积

复盘/校验默认不调用 download_batch、get_local_data、get_market_data_ex、get_market_data。

可选 --try-history:先 download_batch 指数日线,再 get_market_data 子进程补历史并写入缓存(QMT 异常时慎用)。

推荐补齐近 3 日缺口(历史缺失时):

bash
# 1. 下载指数日线(仅 3 只,勿全市场)
python -c "
from datetime import date, timedelta
import sys; sys.path.insert(0,'skills/_shared')
from common import load_env_files, make_client
import argparse
load_env_files()
c,_=make_client(argparse.Namespace(host='127.0.0.1',port=8080,api_key='test-auto',account_id=None),False)
e=date.today().strftime('%Y%m%d'); s=(date.today()-timedelta(days=12)).strftime('%Y%m%d')
print(c.download_batch(['000001.SH','399106.SZ','399001.SZ'], period='1d', start_time=s, end_time=e))
"

# 2. 读 amount 写入缓存并展示明细
python skills/qmt-bridge-kline-backfill/scripts/index_turnover_recent.py \
  --host 127.0.0.1 --port 8080 --try-history

脚本

bash
# 查看近3日上证+深证成交额明细(亿元)
python skills/qmt-bridge-kline-backfill/scripts/index_turnover_recent.py \
  --host 127.0.0.1 --port 8080

# 查看近3日成交额明细;历史缺口加 --try-history
python skills/qmt-bridge-kline-backfill/scripts/index_turnover_recent.py \
  --host 127.0.0.1 --port 8080

# 可选:尝试从本地 K 线补历史(慎用,优先用上一条)
python skills/qmt-bridge-kline-backfill/scripts/index_turnover_recent.py \
  --try-history --host 127.0.0.1 --port 8080

# 兼容旧入口(同上逻辑)
python skills/qmt-bridge-kline-backfill/scripts/backfill_recent_index_kline.py --json

参数

参数说明
--days需要覆盖的最近交易日数量(默认 3)
--try-history可选尝试 get_market_data 补历史(默认关闭)
--json输出机器可读结果

输出说明

  • ok=true:近 N 个交易日缓存/tick 均有沪+深成交额
  • ok=false:列出缺失交易日;连续多日收盘复盘会自动写入缓存
  • method:默认 full_tick+cache

排障

  1. 当日 tick 失败 → 检查 QMT 登录与行情
  2. 历史不足 → 正常(需多日累积);勿反复跑 --try-history
  3. BSON / 服务无响应 → 重启 QMT 客户端,再重启 Bridge

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Qmt Bridge Kline Backfill AI skill do?

校验近N个交易日两市成交额(上证+深证)是否可用于复盘。默认仅用 get_full_tick 写当日 与本地日缓存,不拉历史 K 线。用户提到补齐K线、近3日量能缺失、复盘前校验时使用。

Why use Qmt Bridge Kline Backfill on TypingMind?

Because you install it once and use it with any model. Qmt Bridge Kline Backfill is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Qmt Bridge Kline Backfill in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/atorber/qmt-trading-skill/tree/main/skills/qmt-bridge-kline-backfill. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Qmt Bridge Kline Backfill?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Qmt Bridge Kline Backfill?

As many as you like. As long as a model supports skills, you can use Qmt Bridge Kline Backfill with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Qmt Bridge Kline Backfill AI skill free?

Yes. It is published on GitHub by atorber under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇