Metadata-Version: 2.4
Name: deltafq
Version: 0.3.0
Summary: A comprehensive Python quantitative finance library
Author-email: DeltaF <leek_li@outlook.com>
License: MIT
Project-URL: Homepage, https://github.com/Delta-F/deltafq
Project-URL: Repository, https://github.com/Delta-F/deltafq
Project-URL: Issues, https://github.com/Delta-F/deltafq/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Office/Business :: Financial :: Investment
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.21.0
Requires-Dist: pandas>=1.3.0
Requires-Dist: scipy>=1.7.0
Requires-Dist: matplotlib>=3.4.0
Requires-Dist: yfinance>=0.1.70
Requires-Dist: requests>=2.25.0
Provides-Extra: viz
Requires-Dist: plotly>=5.0.0; extra == "viz"
Provides-Extra: talib
Requires-Dist: TA-Lib>=0.4.24; extra == "talib"
Provides-Extra: dev
Requires-Dist: pytest>=6.2.0; extra == "dev"
Requires-Dist: pytest-cov>=2.12.0; extra == "dev"
Requires-Dist: black>=21.0.0; extra == "dev"
Requires-Dist: flake8>=3.9.0; extra == "dev"
Requires-Dist: sphinx>=4.0.0; extra == "dev"
Dynamic: license-file

# DeltaFQ

Modern Python library for strategy research, backtesting, paper/live trading, and beautiful reporting.

## Highlights

- **Clean architecture**: `data` → `strategy` (signals) → `backtest` (execution) → `performance` (metrics) → `reporter` (text + charts)
- **Execution engine**: Unified order execution for paper/live trading via a `Broker` abstraction
- **Indicators**: Rich `TechnicalIndicators` (SMA/EMA/RSI/KDJ/BOLL/ATR/…)
- **Signals**: Simple, composable `SignalGenerator` (e.g., Bollinger `touch`/`cross`/`cross_current`)
- **Charts**: Matplotlib by default, optional Plotly interactive performance charts
- **Reports**: Console-friendly summary with i18n (Chinese/English) + visual charts

## Install

```bash
pip install deltafq
```

## 60-second Quick Start (Bollinger strategy)

```python
import deltafq as dfq

symbol = 'AAPL'
fetcher = dfq.data.DataFetcher(); indicators = dfq.indicators.TechnicalIndicators()
generator = dfq.strategy.SignalGenerator()
engine = dfq.backtest.BacktestEngine(initial_capital=100000)
perf = dfq.backtest.PerformanceAnalyzer(); reporter = dfq.backtest.BacktestReporter()

data = fetcher.fetch_data(symbol, '2023-01-01', '2023-12-31', clean=True)
bands = indicators.boll(data['Close'], period=20, std_dev=2)
signals = generator.boll_signals(price=data['Close'], bands=bands, method='cross_current')

trades_df, values_df = engine.run_backtest(symbol, signals, data['Close'], strategy_name='BOLL')
values_df, metrics = perf.get_performance_metrics(symbol, trades_df, values_df, engine.initial_capital)

# Text + charts; pass use_plotly=True inside reporter if you want interactive charts
reporter.generate_visual_report(metrics=metrics, values_df=values_df, title=f'{symbol} BOLL Strategy')
```

## What’s inside

- `deltafq/data`: fetching, cleaning, validation
- `deltafq/indicators`: classic TA indicators
- `deltafq/strategy`: signal generation + signal combination
- `deltafq/backtest`: execution via `ExecutionEngine`; performance via `PerformanceAnalyzer`; reporting via `BacktestReporter`
- `deltafq/charts`: signal and performance charts (Matplotlib + optional Plotly)

## Examples

See the `examples/` folder for ready-to-run scripts:

- Compare indicators and signals
- Run a Bollinger strategy and generate a full report

## Contributing

Contributions are welcome! Please open an issue or submit a PR.

## License

MIT License – see [LICENSE](LICENSE).
