# shinnytech/tqsdk-python

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/shinnytech-tqsdk-python).**

4,789 stars · 760 forks · Python · Apache-2.0

## Links

- GitHub: https://github.com/shinnytech/tqsdk-python
- Homepage: https://doc.shinnytech.com/tqsdk/latest
- awesome-repositories: https://awesome-repositories.com/repository/shinnytech-tqsdk-python.md

## Description

tqsdk-python is a quantitative trading SDK and framework designed for developing automated strategies for futures, options, and stocks using Python. It functions as an algorithmic trading engine and financial market data API, providing the tools necessary to backtest strategies, analyze historical data, and execute live trades across multiple brokerage accounts.

The project distinguishes itself through a specialized option analytics library that calculates Greeks, implied volatility, and volatility surfaces using the Black-Scholes model. It further supports complex order execution patterns, such as TWAP, Iceberg, and POV, to minimize market impact during position entry and exit.

The SDK covers a broad capability surface including real-time and historical market data retrieval, quantitative risk management, and portfolio monitoring. It incorporates an asynchronous execution model for data streaming and task scheduling, alongside tools for multi-asset trading simulation and performance analysis.

The library provides a web-based graphical interface for strategy monitoring and data visualization.

## Tags

### Business & Productivity Software

- [Algorithmic Trading Engines](https://awesome-repositories.com/f/business-productivity-software/algorithmic-trading-engines.md) — Functions as a core execution engine supporting advanced order types like TWAP and Iceberg for automated trading.
- [Quantitative Trading Platforms](https://awesome-repositories.com/f/business-productivity-software/quantitative-trading-platforms.md) — Provides an integrated environment for developing, backtesting, and executing algorithmic financial trading strategies across multiple asset classes. ([source](https://cdn.jsdelivr.net/gh/shinnytech/tqsdk-python@main/README.md))
- [Live Trading Execution](https://awesome-repositories.com/f/business-productivity-software/live-trading-execution.md) — Connects to multiple brokerage firms to perform live trading or simulate orders in a paper-trading environment. ([source](https://doc.shinnytech.com/tqsdk/latest/intro.html))
- [Stock Trade Executions](https://awesome-repositories.com/f/business-productivity-software/live-trading-execution/stock-trade-executions.md) — Adjusts net positions using TWAP or VWAP algorithms to minimize market impact during execution. ([source](https://doc.shinnytech.com/tqsdk/latest/demo/algorithm.html))
- [Multi-Account Portfolio Management](https://awesome-repositories.com/f/business-productivity-software/multi-account-portfolio-management.md) — Coordinates trades across multiple real-money and simulated brokerage accounts with independent P&L tracking.
- [Multi-Account Trading Protocols](https://awesome-repositories.com/f/business-productivity-software/multi-account-trading-protocols.md) — Provides standardized data layers for retrieving and tracking holdings across real, simulated, and demo accounts simultaneously. ([source](https://doc.shinnytech.com/tqsdk/latest/demo/base.html))
- [Algorithmic Order Types](https://awesome-repositories.com/f/business-productivity-software/on-chain-order-books/order-placements/algorithmic-order-types.md) — Implements advanced execution patterns like Iceberg and POV to minimize market impact. ([source](https://doc.shinnytech.com/tqsdk/latest/demo/strategy.html))
- [Trading Order Monitors](https://awesome-repositories.com/f/business-productivity-software/order-lifecycle-management/trading-order-monitors.md) — Ships tools for sending and monitoring trade requests for financial instruments to automate buying and selling. ([source](https://doc.shinnytech.com/tqsdk/latest/_sources/index.rst.txt))
- [In-Memory Trading Stores](https://awesome-repositories.com/f/business-productivity-software/order-lifecycle-management/trading-order-monitors/in-memory-trading-stores.md) — Maintains an in-memory snapshot of quotes and account information updated via websocket. ([source](https://doc.shinnytech.com/tqsdk/latest/usage/framework.html))
- [Real-Time Market Prices](https://awesome-repositories.com/f/business-productivity-software/pricing-structures/pricing-data-retrieval/real-time-market-prices.md) — Retrieves real-time quote and k-line data for financial contracts to analyze market price movements. ([source](https://doc.shinnytech.com/tqsdk/latest/demo/strategy.html))
- [Trading Simulations](https://awesome-repositories.com/f/business-productivity-software/trading-simulations.md) — Provides environments for testing and executing financial strategies using accounts with persistent funds and positions. ([source](https://doc.shinnytech.com/tqsdk/latest/quickstart.html))
- [Multi-Asset Class Simulations](https://awesome-repositories.com/f/business-productivity-software/trading-simulations/multi-asset-class-simulations.md) — Executes tests across futures, options, and stocks using dedicated multi-asset class simulation environments. ([source](https://doc.shinnytech.com/tqsdk/latest/usage/backtest.html))
- [Trading Strategy Backtesters](https://awesome-repositories.com/f/business-productivity-software/trading-strategy-backtesters.md) — Simulates trading logic against historical market data to evaluate performance metrics and risk.
- [Trading Strategy Execution Engines](https://awesome-repositories.com/f/business-productivity-software/trading-strategy-execution-engines.md) — Provides a system to coordinate trading logic by managing background tasks, tracking orders, and executing position changes. ([source](https://doc.shinnytech.com/tqsdk/latest/))
- [Futures Contract Management](https://awesome-repositories.com/f/business-productivity-software/contract-management-systems/futures-contract-management.md) — Retrieves primary contracts corresponding to continuous futures contracts for specific timestamps. ([source](https://doc.shinnytech.com/tqsdk/latest/usage/backtest.html))
- [Options Contract Screeners](https://awesome-repositories.com/f/business-productivity-software/options-contract-screeners.md) — Filters option contracts based on underlying symbols, strike prices, and expiration dates. ([source](https://doc.shinnytech.com/tqsdk/latest/demo/option_base.html))
- [Position Management Automations](https://awesome-repositories.com/f/business-productivity-software/position-management-automations.md) — Maintains a specific net position for a contract by automating order placement and cancellation. ([source](https://doc.shinnytech.com/tqsdk/latest/usage/targetpostask.html))
- [Trade Visualization Tools](https://awesome-repositories.com/f/business-productivity-software/quantitative-trading-platforms/trade-visualization-tools.md) — Renders technical indicators, signals, and K-line charts for visual analysis of price action. ([source](https://doc.shinnytech.com/tqsdk/latest/demo/base.html))
- [Strategy Performance Analyzers](https://awesome-repositories.com/f/business-productivity-software/trading-risk-analysis/strategy-performance-analyzers.md) — Analyzes profitability and risk exposure of trading strategies using virtual accounts and risk metrics. ([source](https://cdn.jsdelivr.net/gh/shinnytech/tqsdk-python@main/README.md))
- [Trading Dashboards](https://awesome-repositories.com/f/business-productivity-software/trading-risk-analysis/trade-profitability-recorders/trading-dashboards.md) — Offers a comprehensive dashboard for monitoring active trades, strategy performance, and portfolio status. ([source](https://doc.shinnytech.com/tqsdk/latest/usage/index.html))
- [Equity Simulations](https://awesome-repositories.com/f/business-productivity-software/trading-simulations/equity-simulations.md) — Executes mock trades for stocks and tracks virtual accounts for strategy validation. ([source](https://doc.shinnytech.com/tqsdk/latest/profession.html))
- [Scenario Analysis](https://awesome-repositories.com/f/business-productivity-software/trading-simulations/scenario-analysis.md) — Estimates risk and reward by calculating potential outcomes through simulated market conditions. ([source](https://doc.shinnytech.com/tqsdk/latest/reference/index.html))
- [Performance Analytics](https://awesome-repositories.com/f/business-productivity-software/trading-strategy-backtesters/performance-analytics.md) — Generates statistical reports on annual yield and profit-loss ratios via graphical analysis. ([source](https://doc.shinnytech.com/tqsdk/latest/usage/backtest.html))
- [Trading Strategy Frameworks](https://awesome-repositories.com/f/business-productivity-software/trading-strategy-frameworks.md) — Provides a specialized software framework for managing multiple automated financial trading strategies across accounts. ([source](https://doc.shinnytech.com/tqsdk/latest/version.html))

### Artificial Intelligence & ML

- [Technical Indicator Calculators](https://awesome-repositories.com/f/artificial-intelligence-ml/market-analysis-agents/financial-market-analysis-platforms/technical-indicator-calculators.md) — Calculates technical indicators and analyzes market datasets using optimized numerical libraries to identify trends. ([source](https://cdn.jsdelivr.net/gh/shinnytech/tqsdk-python@main/README.md))

### Part of an Awesome List

- [Financial Data APIs](https://awesome-repositories.com/f/awesome-lists/data/financial-data-apis.md) — Provides an interface for retrieving real-time quotes, tick-level data, and K-line series from financial exchanges.
- [Arbitrage Trading](https://awesome-repositories.com/f/awesome-lists/data/arbitrage-trading.md) — Monitors price spreads between related contracts to execute mean-reversion or hedge trades. ([source](https://doc.shinnytech.com/tqsdk/latest/demo/strategy.html))
- [Derivative Arbitrage](https://awesome-repositories.com/f/awesome-lists/data/arbitrage-trading/derivative-arbitrage.md) — Monitors price spreads between options and underlying futures to place offsetting orders. ([source](https://doc.shinnytech.com/tqsdk/latest/demo/option_base.html))
- [Trading Strategy Schedulers](https://awesome-repositories.com/f/awesome-lists/devops/tasks-and-scheduling/trading-strategy-schedulers.md) — Provides interfaces for scheduling the automated start, stop, and restart of concurrent trading strategy instances. ([source](https://doc.shinnytech.com/tqsdk/latest/advanced/index.html))
- [Trading Platforms](https://awesome-repositories.com/f/awesome-lists/devtools/trading-platforms.md) — Python development kit for futures and stock trading.

### Data & Databases

- [Tick Data Retrieval](https://awesome-repositories.com/f/data-databases/data-retrieval-pipelines/tick-data-retrieval.md) — Provides chronological sequences of tick-by-tick market updates as structured data frames. ([source](https://doc.shinnytech.com/tqsdk/latest/usage/mddatas.html))
- [Dataframe Structures](https://awesome-repositories.com/f/data-databases/data-structures/dataframe-structures.md) — Converts sequential market tick and k-line data into structured DataFrames for optimized numerical analysis.
- [Greeks Calculators](https://awesome-repositories.com/f/data-databases/derivative-option-chains/greeks-calculators.md) — Computes option sensitivities including Delta, Theta, Gamma, Vega, and Rho to assess derivative risk. ([source](https://doc.shinnytech.com/tqsdk/latest/demo/base.html))
- [Financial Market Analysis](https://awesome-repositories.com/f/data-databases/financial-market-analysis.md) — Retrieves real-time and historical data to calculate technical indicators and analyze market trends.
- [In-Memory State Stores](https://awesome-repositories.com/f/data-databases/in-memory-databases/in-memory-state-stores.md) — Maintains a real-time in-memory snapshot of market quotes and account information for low-latency access.
- [Market Data Access APIs](https://awesome-repositories.com/f/data-databases/market-data-access-apis.md) — Provides programmatic interfaces to retrieve real-time and historical price and volume data. ([source](https://doc.shinnytech.com/tqsdk/latest/demo/index.html))
- [Market Data Providers](https://awesome-repositories.com/f/data-databases/market-data-providers.md) — Fetches tick-level and K-line market data directly without requiring a local database. ([source](https://cdn.jsdelivr.net/gh/shinnytech/tqsdk-python@main/README.md))
- [Bond Market Quotes](https://awesome-repositories.com/f/data-databases/market-data-providers/bond-market-quotes.md) — Fetches current prices, order book depth, and contract specifications for financial instruments. ([source](https://doc.shinnytech.com/tqsdk/latest/usage/mddatas.html))
- [Candlestick Data Retrievers](https://awesome-repositories.com/f/data-databases/market-data-providers/candlestick-data-retrievers.md) — Fetches historical and real-time candlestick data as DataFrames for technical analysis. ([source](https://doc.shinnytech.com/tqsdk/latest/quickstart.html))
- [Market Data Aggregators](https://awesome-repositories.com/f/data-databases/market-data-providers/market-data-aggregators.md) — Merges multiple tick and K-line data series to ensure chronological updates across instruments. ([source](https://doc.shinnytech.com/tqsdk/latest/usage/backtest.html))
- [Exchange Market Data Streams](https://awesome-repositories.com/f/data-databases/real-time-data-streaming/exchange-market-data-streams.md) — Provides live streams of quotes, tick serials, and k-line data that update automatically. ([source](https://doc.shinnytech.com/tqsdk/latest/demo/base.html))
- [WebSocket Stream Managers](https://awesome-repositories.com/f/data-databases/real-time-data-streaming/stream-subscriptions/websocket-stream-managers.md) — Updates local market and account states via a persistent WebSocket connection with subscription management.
- [Real-time Data Synchronization](https://awesome-repositories.com/f/data-databases/real-time-data-synchronization.md) — Synchronizes local data state by polling servers for new business data packets in real time. ([source](https://doc.shinnytech.com/tqsdk/latest/usage/framework.html))
- [Real-Time State Maintenance](https://awesome-repositories.com/f/data-databases/real-time-state-maintenance.md) — Merges incoming data packets into a memory store and converts sequential data into dataframes for instant querying. ([source](https://doc.shinnytech.com/tqsdk/latest/dev_framework.html))
- [Margin](https://awesome-repositories.com/f/data-databases/balance-specifications/balance-tracking/margin.md) — Simulates market scenarios to estimate real-time margin usage and potential risk levels. ([source](https://doc.shinnytech.com/tqsdk/latest/version.html))
- [Theoretical Margin Estimators](https://awesome-repositories.com/f/data-databases/balance-specifications/balance-tracking/margin/theoretical-margin-estimators.md) — Estimates the theoretical margin required for selling ETF options according to exchange regulations. ([source](https://doc.shinnytech.com/tqsdk/latest/demo/option_base.html))
- [Trade History Exporters](https://awesome-repositories.com/f/data-databases/data-retrieval-pipelines/tick-data-retrieval/trade-history-retrieval/trade-history-exporters.md) — Exports K-line and tick data to CSV files for external quantitative analysis. ([source](https://doc.shinnytech.com/tqsdk/latest/demo/base.html))
- [Financial Instrument Metadata Querying](https://awesome-repositories.com/f/data-databases/financial-instrument-metadata-querying.md) — Searches for financial contracts based on instrument class, exchange, product ID, or expiration status. ([source](https://doc.shinnytech.com/tqsdk/latest/demo/base.html))
- [Historical Trade Data Retrievers](https://awesome-repositories.com/f/data-databases/market-data-providers/candlestick-data-retrievers/historical-trade-data-retrievers.md) — Retrieves current and historical market price data for stocks and indices. ([source](https://doc.shinnytech.com/tqsdk/latest/profession.html))
- [Historical Data Downloads](https://awesome-repositories.com/f/data-databases/market-data-providers/historical-data-downloads.md) — Provides capabilities to export high-precision tick-level and K-line historical data to local storage. ([source](https://doc.shinnytech.com/tqsdk/latest/profession.html))
- [International Market Data Access](https://awesome-repositories.com/f/data-databases/market-data-providers/international-market-data-access.md) — Retrieves delayed price data and contract lists for global futures and indices across international exchanges. ([source](https://doc.shinnytech.com/tqsdk/latest/usage/kqd_symbol.html))
- [Order Execution Pipelines](https://awesome-repositories.com/f/data-databases/real-time-data-streaming/trade-event-streams/order-execution-pipelines.md) — Sends order requests and receives market updates through asynchronous pipelines to decouple the user interface from the gateway. ([source](https://doc.shinnytech.com/tqsdk/latest/dev_framework.html))

### Development Tools & Productivity

- [Trading Strategy Development Environments](https://awesome-repositories.com/f/development-tools-productivity/python-development-tools/script-execution-engines/python-scripting-environments/trading-strategy-development-environments.md) — Provides a Python-native environment for writing, testing, and running algorithmic trading strategies.
- [External Terminal Integrations](https://awesome-repositories.com/f/development-tools-productivity/trading-command-interfaces/external-terminal-integrations.md) — Integrates quantitative research tools with professional trading terminals for high-volume order execution. ([source](https://doc.shinnytech.com/tqsdk/latest/enterprise.html))

### Networking & Communication

- [Trading Gateways](https://awesome-repositories.com/f/networking-communication/trading-gateways.md) — Provides the connectivity layer required for interacting with financial exchange APIs and brokerage counters. ([source](https://doc.shinnytech.com/tqsdk/latest/version.html))
- [Asynchronous Task Schedulers](https://awesome-repositories.com/f/networking-communication/asynchronous-task-schedulers.md) — Dispatches background tasks within an event loop to ensure thread-safe and timely data processing. ([source](https://doc.shinnytech.com/tqsdk/latest/dev_framework.html))
- [Direct Connection Routing](https://awesome-repositories.com/f/networking-communication/direct-connection-routing.md) — Establishes direct connections to brokerage servers to minimize trade latency by bypassing intermediary relay servers. ([source](https://doc.shinnytech.com/tqsdk/latest/enterprise.html))

### Programming Languages & Runtimes

- [Asynchronous Event Loops](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/concurrency-models/asynchronous-event-loops.md) — Coordinates background tasks and strategy logic using a synchronized asynchronous event loop for timely execution.

### Scientific & Mathematical Computing

- [Financial Option Pricing](https://awesome-repositories.com/f/scientific-mathematical-computing/black-scholes-models/financial-option-pricing.md) — Computes Greek indicators and implied volatility using the Black-Scholes model for risk assessment. ([source](https://doc.shinnytech.com/tqsdk/latest/usage/option_trade.html))
- [Futures Trading Engines](https://awesome-repositories.com/f/scientific-mathematical-computing/commodity-futures-pricing/futures-trading-engines.md) — Provides an execution engine for automated futures and options trading strategies including margin and settlement logic.
- [Option Volatility Analysis](https://awesome-repositories.com/f/scientific-mathematical-computing/numerical-mathematical-foundations/statistics-probability/statistical-estimation/financial-volatility-estimators/option-volatility-analysis.md) — Calculates Greeks and implied volatility to assess risk and identify arbitrage opportunities in options.
- [Volatility Surface Generators](https://awesome-repositories.com/f/scientific-mathematical-computing/numerical-mathematical-foundations/statistics-probability/statistical-estimation/financial-volatility-estimators/option-volatility-analysis/volatility-surface-generators.md) — Constructs volatility curves by analyzing groups of option contracts and their underlying assets. ([source](https://doc.shinnytech.com/tqsdk/latest/demo/option_base.html))
- [Option Analytics Libraries](https://awesome-repositories.com/f/scientific-mathematical-computing/option-analytics-libraries.md) — Calculates option Greeks, implied volatility, and volatility surfaces using the Black-Scholes model.
- [Algorithmic Order Executions](https://awesome-repositories.com/f/scientific-mathematical-computing/order-execution-engines/algorithmic-order-executions.md) — Implements advanced trading patterns like TWAP and Iceberg orders to minimize market impact.
- [Order Lifecycle Management](https://awesome-repositories.com/f/scientific-mathematical-computing/order-execution-engines/trade-order-dispatchers/order-lifecycle-management.md) — Handles the full lifecycle of buy and sell orders, including placement, cancellation, and status tracking. ([source](https://doc.shinnytech.com/tqsdk/latest/demo/base.html))
- [Moneyness Classifications](https://awesome-repositories.com/f/scientific-mathematical-computing/money-market-deposit-valuations/moneyness-classifications.md) — Categorizes options as in-the-money, at-the-money, or out-of-the-money relative to the underlying asset price. ([source](https://doc.shinnytech.com/tqsdk/latest/demo/option_base.html))
- [Strategy Parameter Optimization](https://awesome-repositories.com/f/scientific-mathematical-computing/strategy-parameter-optimization.md) — Provides mathematical methods for finding optimal configurations of quantitative trading parameters. ([source](https://doc.shinnytech.com/tqsdk/latest/advanced/index.html))
- [Technical Indicators](https://awesome-repositories.com/f/scientific-mathematical-computing/technical-indicators.md) — The trading library calculates quantitative metrics such as Bollinger Bands and Moving Averages using market data. ([source](https://doc.shinnytech.com/tqsdk/latest/demo/strategy.html))

### Security & Cryptography

- [Unified Trading Interfaces](https://awesome-repositories.com/f/security-cryptography/account-management/account-grouping-utilities/trading-account-groups/unified-trading-interfaces.md) — Offers a unified interface for monitoring positions and executing orders across multiple brokerage accounts. ([source](https://doc.shinnytech.com/tqsdk/latest/reference/index.html))
- [Trading Risk Management](https://awesome-repositories.com/f/security-cryptography/trading-risk-management.md) — Implements advanced order instructions and target position tasks to enforce risk constraints and protect capital. ([source](https://doc.shinnytech.com/tqsdk/latest/advanced/index.html))
- [Trading Account Session Linking](https://awesome-repositories.com/f/security-cryptography/account-management/account-grouping-utilities/trading-account-groups/trading-account-session-linking.md) — Links real, simulated, or cloud-based trading accounts to a session for executing trades. ([source](https://doc.shinnytech.com/tqsdk/latest/usage/trade.html))
- [Multi-Account Session Management](https://awesome-repositories.com/f/security-cryptography/multi-account-session-management.md) — Links multiple real and simulated trading identities to a single session for synchronized execution.
- [API Rate Limit Management](https://awesome-repositories.com/f/security-cryptography/request-size-limiters/request-limiters/request-throttling/client-request-quotas/api-rate-limit-management.md) — Implements client-side rate limiting to cap order operations and prevent API throttling from brokerages. ([source](https://doc.shinnytech.com/tqsdk/latest/version.html))

### DevOps & Infrastructure

- [Timed Event Scheduling](https://awesome-repositories.com/f/devops-infrastructure/automation-orchestration/task-execution-frameworks/task-job-management/task-schedulers/delayed-task-scheduling/timed-event-scheduling.md) — Triggers trading actions and strategy adjustments based on defined recurring time intervals or specific delays. ([source](https://doc.shinnytech.com/tqsdk/latest/advanced/index.html))
- [Trading Strategy Management Interfaces](https://awesome-repositories.com/f/devops-infrastructure/control-planes/cli-and-web-gui-operation-interfaces/trading-strategy-management-interfaces.md) — Provides a web-based graphical interface for the real-time monitoring and management of trading strategies. ([source](https://doc.shinnytech.com/tqsdk/latest/usage/web_gui.html))

### Software Engineering & Architecture

- [Client-Server Architectures](https://awesome-repositories.com/f/software-engineering-architecture/client-server-architectures.md) — Decouples strategy logic and user interfaces from financial exchanges via a secure brokerage communication gateway.

### System Administration & Monitoring

- [Market Insight Monitors](https://awesome-repositories.com/f/system-administration-monitoring/market-insight-monitors.md) — Detects updates in quote fields or k-line data to trigger automated trading logic. ([source](https://doc.shinnytech.com/tqsdk/latest/demo/base.html))
- [Account Statistics Monitoring](https://awesome-repositories.com/f/system-administration-monitoring/monitoring-and-observability/account-statistics-monitoring.md) — Tracks real-time account equity and position volumes to monitor trading performance. ([source](https://doc.shinnytech.com/tqsdk/latest/profession.html))
- [Financial Position Monitoring](https://awesome-repositories.com/f/system-administration-monitoring/monitoring-and-observability/account-statistics-monitoring/financial-position-monitoring.md) — Tracks available funds and current position volumes for specific financial contracts in real-time. ([source](https://doc.shinnytech.com/tqsdk/latest/quickstart.html))
- [Target Position Setting](https://awesome-repositories.com/f/system-administration-monitoring/monitoring-and-observability/observability-platforms/metric-performance-monitors/portfolio-metric-trackers/target-position-setting.md) — Automates the calculation and execution of orders required to reach specific asset quantity or volume targets. ([source](https://doc.shinnytech.com/tqsdk/latest/demo/base.html))
