TqSdk Trading and Data for Openclaw

A specialized skill for developing, debugging, and optimizing algorithmic trading strategies using the TqSdk Python framework.

shinny-xuyida
v1.0.0
Mar 16, 2026
1
896
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install tqsdk-skill

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 tqsdk-skill 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 TqSdk Trading and Data?

This skill provides comprehensive support for the TqSdk Python library, enabling developers to build robust algorithmic trading systems. It covers the entire lifecycle of trading development, from retrieving real-time market data and historical K-line series to managing complex order execution and performing backtests. By leveraging Openclaw Skills, developers can quickly implement the mandatory wait_update loop, handle both futures and stock accounts correctly, and utilize advanced tools like TargetPosTask for automated position management.

TqSdk Trading and Data Use Cases

  • Retrieving real-time market quotes and historical tick or K-line data for futures and stocks.
  • Implementing automated trading strategies with efficient update loops using wait_update.
  • Managing multiple trading accounts and executing complex orders with built-in execution helpers.
  • Performing high-fidelity backtesting and simulations to validate strategy performance.
  • Debugging common TqSdk errors and optimizing data download workflows using DataDownloader.

How TqSdk Trading and Data Works

  1. Routing the request to specific TqSdk reference modules based on the trading task (data, orders, or account management).
  2. Initializing the TqApi with appropriate account credentials like TqAccount, TqSim, or TqKq.
  3. Setting up the core update loop to process market events and state changes effectively.
  4. Retrieving live data references and monitoring field changes via is_changing notifications.
  5. Executing trades or adjusting target positions using specialized tasks and order functions.

TqSdk Trading and Data Setup

To get started with this skill, ensure you have the TqSdk library installed in your Python environment.

pip install tqsdk

Initialize your trading script by importing the necessary components and setting up your TqApi instance with authentication:

from tqsdk import TqApi, TqAuth
api = TqApi(auth=TqAuth("your_username", "your_password"))

TqSdk Trading and Data Data Schema & Taxonomy

The skill organizes information across several key technical domains to ensure accurate trading logic:

Component Description Key Metadata/Fields
Market Data Quotes, K-lines, and Ticks symbol, last_price, datetime, volume, open_interest
Account Info Futures and Stock account data balance, available, frozen, risk_ratio, float_profit
Trading Objects Active Orders and Positions order_id, direction, offset, volume_orign, status
Task Helpers Execution and Scheduling target_pos, price_mode, interval, active_tasks

TqSdk Trading and Data Advanced Features

  • Support for TqMultiAccount to manage multiple brokerage accounts simultaneously within a single script.
  • Automated position adjustment and balancing using TargetPosTask and TargetPosScheduler.
  • Advanced execution algorithms including TWAP and VWAP via the tqsdk.algorithm module supported by Openclaw Skills.
  • Efficient historical data management and bulk storage with the DataDownloader tool.
  • High-fidelity simulation and backtesting environments tailored for both futures and stock market mechanics.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*