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.
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/
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
Contributing
- Feedback: Contributions and bug reports are welcome via Issue or PRs.
- WeChat Account: Follow
DeltaFQ开源量化for updates, strategies, and 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-0.6.2.tar.gz.
File metadata
- Download URL: deltafq-0.6.2.tar.gz
- Upload date:
- Size: 39.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
210ec84aa5530c4a92109b11785c1851048b50abede61338dbc84e81aa466d27
|
|
| MD5 |
e1819ca3ac7ed6e978376ce58a6cb6d8
|
|
| BLAKE2b-256 |
d8d1c2c476802cf886b44e24cdefdecdcde465e9b4db42abbb26069cf7e85e00
|
File details
Details for the file deltafq-0.6.2-py3-none-any.whl.
File metadata
- Download URL: deltafq-0.6.2-py3-none-any.whl
- Upload date:
- Size: 45.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17b8170cde65dfe6365db3567035ff6926e1a93fb09d98a7176e18ac9c7bb397
|
|
| MD5 |
0c1b702070fd8a6850c1e5926fa08669
|
|
| BLAKE2b-256 |
05221483f92c0d33303602a2f0a9298f155a17dd86cdb01604c0ff3d703fda45
|