Skip to main content

A-share low-frequency quantitative trading framework covering research, backtesting, and execution

Project description

DeltaFQ

中文 | English

Version Platform Python Build License

Python Open-source Quantitative Framework: Covering the full "Research, Backtest, Trade" lifecycle, building an industrial-grade closed-loop quantitative workflow from scratch to production.

Strategy Signals Backtest Overview

🎓 Official Tutorials

iMOOC - AI Quantitative System Course

Official Course: Deeply deconstructing the framework's architecture from 0 to 1, covering live trading logic and industrial-grade quantitative development. An essential course for mastering DeltaFQ.

📦 Installation

pip install deltafq

For previous version source code, visit: https://pypi.org/project/deltafq/#history

✨ Key Features

  • 📥 Multi-source Data - Global multi-market historical/real-time data, ready to use
  • 🧠 Rapid Development - Signal-driven architecture, fast implementation with strategy templates
  • 📉 Professional Backtesting - High-performance matching engine, deep performance metrics and analysis
  • ⚡ Event-driven - Second-level market data distribution, millisecond-level Tick signal processing
  • 🤖 Live Gateway - Pluggable adapters, seamless switching between simulation and live trading

⚡ Quick Start

import deltafq as dfq

# 1. Define strategy logic
class MyStrategy(dfq.strategy.BaseStrategy):
    def generate_signals(self, data):
        bands = dfq.indicators.TechnicalIndicators().boll(data["Close"])
        return dfq.strategy.SignalGenerator().boll_signals(data["Close"], bands)

# 2. Minimal backtest & results
engine = dfq.backtest.BacktestEngine()
engine.set_parameters("GOOGL", "2025-07-26", "2026-01-26")
engine.load_data()
engine.add_strategy(MyStrategy(name="BOLL"))
engine.run_backtest()
engine.show_report()
engine.show_chart(use_plotly=False)

🚀 Application Example

DeltaFStation is an open-source quantitative trading cloud platform based on deltafq, integrating data services, strategy management, and trading access with paper and live support. Project: https://github.com/Delta-F/deltafstation/

DeltaFStation Architecture DeltaFStation Backtest Engine

🔌 Interface Integration

  • [Data] yfinance ✅ - US, A-shares, HK, Crypto, Indices
  • [Data] eastmoney ✅ - OTC Funds (Index, QDII, Stock, Bond, Mixed)
  • [Data] miniQMT ✅ - A-share market data integration (see live trading section in the course)
  • [Trade] PaperTrade ✅ - Local simulation, tick-driven order matching, position and order management
  • [Trade] miniQMT Trade ✅ - A-share live trading (see live trading section in the course)

Minimal miniQMT live trade setup

from deltafq.live import LiveEngine

engine = LiveEngine(symbol="000001.SZ", signal_interval="1m")
engine.set_data_gateway("miniqmt", interval=3.0, mode="poll")
engine.set_trade_gateway(
    "miniqmt",
    userdata_mini_path=r"D:\BrokerQMT\userdata_mini",
    account_id="1234567890",
)

See details: documents/MiniQmtTrade.md

🏗️ Project Architecture

deltafq/
├── data        # Data acquisition, cleaning, storage interfaces (stocks, funds)
├── indicators  # Technical indicators and factor calculations
├── strategy    # Signal generators and strategy base classes
├── backtest    # Backtest execution, performance metrics, reporting
├── live        # Event engine, gateway abstraction, routing
├── adapters    # Pluggable data/trade adapters
├── trader      # Execution with order/position management
└── charts      # Signal/performance chart components

documents/      # Usage guides and architecture docs
├── LiveEngine.md
├── MiniQmtTrade.md
└── BacktestEngine.md
Project Architecture Workflow

🤝 Contributing

  • Feedback: Bug reports and contributions are welcome via Issue or Pull Requests.
  • WeChat Official Account: Follow DeltaFQ开源量化 for updates, strategies, and quantitative resources.

WeChat Official Account

📄 License

MIT License. See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deltafq-0.9.1.tar.gz (50.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deltafq-0.9.1-py3-none-any.whl (59.7 kB view details)

Uploaded Python 3

File details

Details for the file deltafq-0.9.1.tar.gz.

File metadata

  • Download URL: deltafq-0.9.1.tar.gz
  • Upload date:
  • Size: 50.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.13

File hashes

Hashes for deltafq-0.9.1.tar.gz
Algorithm Hash digest
SHA256 c5850ca282e287aca308fa8e05aefa1ef804269892ca44d030a591485aa1c9aa
MD5 1d08faf0c82223355d72f457e727c591
BLAKE2b-256 79e3830bbe0a6135aa74235aca26a961789718da093e89a20c0dea358b216346

See more details on using hashes here.

File details

Details for the file deltafq-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: deltafq-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 59.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.13

File hashes

Hashes for deltafq-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 33b221da3b29c8ddf26743ba5530698c6dbe9c376513f85080d65ea927ffa33b
MD5 5a6b273f8c4bb8da5b52e3fe0b461d1a
BLAKE2b-256 819dda33de9f89d13353c380f9415cae43c0c324c4a71baa619f7a4d7caa3202

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page