Metadata-Version: 2.4
Name: deltafq
Version: 0.2.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: seaborn>=0.11.0
Requires-Dist: plotly>=5.0.0
Requires-Dist: yfinance>=0.1.70
Requires-Dist: requests>=2.25.0
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

A comprehensive Python quantitative finance library for strategy development, backtesting, and live trading.

## Features

- **Data Management**: Efficient data fetching, cleaning, and storage
- **Strategy Framework**: Flexible strategy development framework
- **Backtesting**: High-performance historical data backtesting
- **Paper Trading**: Risk-free strategy testing with simulated trading
- **Live Trading**: Real-time trading with broker integration
- **Technical Indicators**: Rich library of technical analysis indicators
- **Risk Management**: Built-in risk control modules

## Installation

```bash
pip install deltafq
```

## Quick Start

```python
import deltafq as dfq

# Fetch market data
fetcher = dfq.data.DataFetcher()
fetcher.initialize()
data = fetcher.fetch_stock_data('AAPL', '2023-01-01', '2023-12-31')

# Clean and validate data
cleaner = dfq.data.DataCleaner()
cleaner.initialize()
cleaned_data = cleaner.clean_price_data(data)

validator = dfq.data.DataValidator()
validator.initialize()
validator.validate_price_data(cleaned_data)

# Create and test a strategy
class SimpleMAStrategy(dfq.strategy.BaseStrategy):
    def __init__(self, fast_period=10, slow_period=20):
        super().__init__()
        self.fast_period = fast_period
        self.slow_period = slow_period
    
    def generate_signals(self, data):
        fast_ma = data['close'].rolling(window=self.fast_period).mean()
        slow_ma = data['close'].rolling(window=self.slow_period).mean()
        import numpy as np
        signals = np.where(fast_ma > slow_ma, 1, np.where(fast_ma < slow_ma, -1, 0))
        return pd.Series(signals, index=data.index)

strategy = SimpleMAStrategy()
strategy.initialize()
results = strategy.run(cleaned_data)

# Run backtest
engine = dfq.backtest.BacktestEngine(initial_capital=100000)
engine.initialize()
backtest_results = engine.run_backtest(strategy, cleaned_data)

# Run paper trading
simulator = dfq.trading.PaperTradingSimulator(initial_capital=100000)
simulator.initialize()
portfolio_summary = simulator.run_strategy(strategy, cleaned_data)
```

## Documentation

- [API Reference](docs/api_reference/)
- [Tutorials](docs/tutorials/)
- [Examples](examples/)

## Contributing

Please read our [Contributing Guide](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
