A-share low-frequency quantitative trading framework covering research, backtesting, and execution
Project description
DeltaFQ
Python Open-source Quantitative Framework: Covering the full "Research, Backtest, Trade" lifecycle, building an industrial-grade closed-loop quantitative workflow from scratch to production.
๐ 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/
๐ 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/LiveEngine.mddocuments/MiniQmtTrade.mddocuments/MiniQmtLiveEngine.md
๐๏ธ Project Architecture
deltafq/
โโโ core/ # Base classes, config, logging
โ โโโ base.py
โ โโโ config.py
โ โโโ logger.py
โโโ data/ # Fetch, clean, store, source mapping
โ โโโ fetcher.py
โ โโโ cleaner.py
โ โโโ storage.py
โ โโโ source_map.py
โ โโโ miniqmt_xtdata.py # miniQMT / xtquant historical bars
โโโ indicators/ # Technical & fundamental factors
โ โโโ technical.py
โ โโโ fundamental.py
โ โโโ talib_indicators.py
โโโ strategy/ # Strategy base & signal generation
โ โโโ base.py
โ โโโ signals.py
โโโ backtest/ # Backtest engine, metrics, reporting
โ โโโ engine.py
โ โโโ metrics.py
โ โโโ performance.py
โโโ live/ # Event engine, gateways, LiveEngine
โ โโโ event_engine.py
โ โโโ gateways.py # DataGateway / TradeGateway abstractions
โ โโโ gateway_registry.py # Gateway factory & registry
โ โโโ engine.py # LiveEngine orchestration
โ โโโ models.py # TickData, OrderRequest, โฆ
โโโ adapters/ # Pluggable data / trade adapters
โ โโโ data/ # Data gateways (yfinance, miniQMT, โฆ)
โ โ โโโ yfinance_gateway.py
โ โ โโโ miniqmt_gateway.py
โ โโโ trade/ # Trade gateways (Paper, miniQMT, โฆ)
โ โโโ paper_gateway.py
โ โโโ miniqmt_client.py # xttrader client wrapper
โ โโโ miniqmt_gateway.py # Limit orders / cancel for LiveEngine
โโโ trader/ # Matching, orders, positions
โ โโโ engine.py
โ โโโ order_manager.py
โ โโโ position_manager.py
โโโ charts/ # Signal, price & performance charts
โโโ signals.py
โโโ price.py
โโโ performance.py
๐ค Contributing
- Feedback: Bug reports and contributions are welcome via Issue or Pull Requests.
- WeChat Official Account: Follow
DeltaFQๅผๆบ้ๅfor updates, strategies, and quantitative resources.
๐ License
MIT License. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deltafq-1.0.2.tar.gz.
File metadata
- Download URL: deltafq-1.0.2.tar.gz
- Upload date:
- Size: 57.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e19dde1ba68c1172d56c835756bdf1792997bb4fc7ccbdb324d4da0a3e30ed4b
|
|
| MD5 |
44851d3cfa0f534a91710c381f6ea2af
|
|
| BLAKE2b-256 |
b46a9b2fdb87a546fa4d09bf2712fc472e58b8648a1b958c377be8df76d29e38
|
File details
Details for the file deltafq-1.0.2-py3-none-any.whl.
File metadata
- Download URL: deltafq-1.0.2-py3-none-any.whl
- Upload date:
- Size: 67.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1eae16a4f7bfd7d6ef82680c5051a793662ffa807592e41ee006b7e1a157df3
|
|
| MD5 |
e3e170478bbfe5cb81b6d769629127c2
|
|
| BLAKE2b-256 |
c1843140e41e30f35803aeb343e4cb997c32298209443f1add370b956798dc38
|