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

Exclusive Tutorials

iMOOC - AI Quantitative System Course: https://class.imooc.com/sale/aiqwm

Installation

pip install deltafq

Key Features

  • 📥 Fetch Historical Data - Built-in free data sources, supporting global markets.
  • 🧪 Common Indicators - Fast calculation of MACD, Bollinger Bands, etc., with TA-Lib support.
  • 🧠 Fast Prototyping - Write logic in a few lines using signal generators and templates.
  • 📉 High-Performance Backtesting - Rapid testing with multi-strategy comparison and performance analysis.
  • ⚡ Live Market Distribution - Event-driven architecture for second-level distribution and Tick processing.
  • 🤖 Paper & Live Trading - Pluggable design for seamless switching between simulation and live brokers.
  • 📊 Interactive Visualization - Auto-generated Plotly charts for precise insights into backtest details.
  • 📝 System Logging - Unified status management with multi-level logging and file storage.

Interface Integration

DeltaFQ flexibly connects to various external interfaces through pluggable Adapters:

  • yfinance - Integrated, supporting multi-market historical and real-time market data.
  • PaperTrade - Integrated, supporting multi-market local simulation and position management.
  • 🛠️ qmt - Planned, supporting A-share live market snapshots and broker execution.
  • 🛠️ Tushare - Planned, providing richer financial fundamental data for A-shares.

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

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
Project Architecture Workflow

Contributing

  • Feedback: Contributions and bug reports are welcome via Issue or PRs.
  • WeChat Account: Follow DeltaFQ开源量化 for updates, strategies, and 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.6.1.tar.gz (38.3 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.6.1-py3-none-any.whl (44.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for deltafq-0.6.1.tar.gz
Algorithm Hash digest
SHA256 b2edb45ac0eff5732a275f02008be81b44eac2824002f8f9de1e1f7778269a7d
MD5 6e0f49fc0c5b91b6b3cf42919f24e129
BLAKE2b-256 6b561425b0f406be0468b1858bff1497a2e6054ce28d5fdae72305dfa4ba80c2

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for deltafq-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 13487c3a6e41e17d07c81689ca7fbd91a6612ca7c7cffb23c25e11879c4db033
MD5 c0de5d64e72bb6b38758c59c1079de6a
BLAKE2b-256 38ededd90e713eb224c8ed5469a9083af17587d436f255ac039643e79e265098

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