Metadata-Version: 2.4
Name: meridianalgo
Version: 6.2.3
Summary: MeridianAlgo Quant Packages - The Complete Quantitative Finance Platform for Professional Developers
Home-page: https://github.com/MeridianAlgo/Python-Packages
Author: Meridian Algorithmic Research Team
Author-email: Meridian Algorithmic Research Team <support@meridianalgo.com>
License: MIT
Project-URL: Bug Reports, https://github.com/MeridianAlgo/Python-Packages/issues
Project-URL: Source, https://github.com/MeridianAlgo/Python-Packages
Project-URL: Documentation, https://meridianalgo.readthedocs.io
Project-URL: Changelog, https://github.com/MeridianAlgo/Python-Packages/blob/main/CHANGELOG.md
Keywords: quantitative-finance,algorithmic-trading,trading,finance,portfolio-optimization,risk-management,portfolio-analytics,execution-algorithms,vwap,twap,market-impact,market-microstructure,liquidity,order-book,statistical-arbitrage,pairs-trading,mean-reversion,factor-models,options-pricing,high-frequency-trading,regime-detection,machine-learning
Classifier: Development Status :: 5 - Production/Stable
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: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Topic :: Office/Business :: Financial :: Investment
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.24.0
Requires-Dist: pandas>=2.0.0
Requires-Dist: scipy>=1.10.0
Requires-Dist: yfinance>=0.2.30
Requires-Dist: requests>=2.31.0
Requires-Dist: matplotlib>=3.7.0
Requires-Dist: seaborn>=0.12.0
Requires-Dist: ta>=0.11.0
Requires-Dist: tqdm>=4.66.0
Requires-Dist: joblib>=1.3.0
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: pytz>=2023.3
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: pytest-xdist>=3.3.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: black>=23.9.0; extra == "dev"
Requires-Dist: isort>=5.12.0; extra == "dev"
Requires-Dist: mypy>=1.5.0; extra == "dev"
Requires-Dist: sphinx>=7.0.0; extra == "dev"
Requires-Dist: sphinx-rtd-theme>=1.3.0; extra == "dev"
Provides-Extra: ml
Requires-Dist: scikit-learn>=1.3.0; extra == "ml"
Requires-Dist: torch>=2.1.0; extra == "ml"
Requires-Dist: statsmodels>=0.14.0; extra == "ml"
Requires-Dist: hmmlearn>=0.3.0; extra == "ml"
Provides-Extra: optimization
Requires-Dist: cvxpy>=1.4.0; extra == "optimization"
Requires-Dist: cvxopt>=1.3.0; extra == "optimization"
Provides-Extra: volatility
Requires-Dist: arch>=6.2.0; extra == "volatility"
Provides-Extra: data
Requires-Dist: lxml>=4.9.0; extra == "data"
Requires-Dist: beautifulsoup4>=4.12.0; extra == "data"
Requires-Dist: polygon-api-client>=1.12.0; extra == "data"
Provides-Extra: distributed
Requires-Dist: ray>=2.7.0; extra == "distributed"
Requires-Dist: dask>=2023.10.0; extra == "distributed"
Provides-Extra: full
Requires-Dist: scikit-learn>=1.3.0; extra == "full"
Requires-Dist: torch>=2.1.0; extra == "full"
Requires-Dist: statsmodels>=0.14.0; extra == "full"
Requires-Dist: hmmlearn>=0.3.0; extra == "full"
Requires-Dist: cvxpy>=1.4.0; extra == "full"
Requires-Dist: arch>=6.2.0; extra == "full"
Requires-Dist: lxml>=4.9.0; extra == "full"
Requires-Dist: beautifulsoup4>=4.12.0; extra == "full"
Provides-Extra: all
Requires-Dist: scikit-learn>=1.3.0; extra == "all"
Requires-Dist: torch>=2.1.0; extra == "all"
Requires-Dist: statsmodels>=0.14.0; extra == "all"
Requires-Dist: hmmlearn>=0.3.0; extra == "all"
Requires-Dist: cvxpy>=1.4.0; extra == "all"
Requires-Dist: cvxopt>=1.3.0; extra == "all"
Requires-Dist: arch>=6.2.0; extra == "all"
Requires-Dist: lxml>=4.9.0; extra == "all"
Requires-Dist: beautifulsoup4>=4.12.0; extra == "all"
Requires-Dist: polygon-api-client>=1.12.0; extra == "all"
Requires-Dist: ray>=2.7.0; extra == "all"
Dynamic: author
Dynamic: home-page
Dynamic: requires-python

# MeridianAlgo
## The Institutional-Grade Quantitative Finance Platform for Professional Developers

[![PyPI version](https://img.shields.io/pypi/v/meridianalgo.svg?style=flat-square&color=blue)](https://pypi.org/project/meridianalgo/)
[![Python versions](https://img.shields.io/pypi/pyversions/meridianalgo.svg?style=flat-square)](https://pypi.org/project/meridianalgo/)
[![License](https://img.shields.io/github/license/MeridianAlgo/Python-Packages.svg?style=flat-square)](LICENSE)
[![Tests](https://img.shields.io/github/actions/workflow/status/MeridianAlgo/Python-Packages/ci.yml?branch=main&style=flat-square&label=tests)](https://github.com/MeridianAlgo/Python-Packages/actions)

**MeridianAlgo** is a comprehensive, production-ready quantitative finance ecosystem for Python. Designed for hedge funds, proprietary trading desks, and independent researchers, it provides a unified interface for the entire quantitative lifecycle—from data acquisition and signal generation to optimal execution and performance attribution.

---

## Institutional Modules

MeridianAlgo is built on a modular "Enterprise Foundation" where every component is optimized for performance and reliability.

### Core Financial Primitives
The bedrock of the platform, providing high-performance implementations of essential financial calculations.
- **Statistical Arbitrage Engine**: Cointegration analysis, Hurst exponent calculation, and Half-life estimation.
- **Advanced Technical Indicators**: Vectorized RSI, MACD, Bollinger Bands, and 50+ other institutional indicators.
- **Robust Market Data**: Unified API for multi-vendor data acquisition with built-in cleaning and alignment.

### Portfolio Management & Optimization
Beyond standard Mean-Variance optimization, we implement robust allocation strategies.
- **Modern Portfolio Theory+**: MVO, Black-Litterman, and Risk Parity (ERC).
- **Hierarchical Risk Parity (HRP)**: Machine-learning based diversification that handles high correlations.
- **Nested Clustered Optimization (NCO)**: Addressing the instability of quadratic programming in financial datasets.
- **Transaction Cost Optimization**: Incorporating market impact and slippage directly into the allocation process.

### Risk Management & Analytics
Comprehensive risk assessment and performance monitoring.
- **Multi-Method VaR**: Parametric (Delta-Normal), Historical Simulation, and Monte Carlo models.
- **Conditional VaR (CVaR)**: Expected Shortfall with tail risk decomposition.
- **Cornish-Fisher Adjustments**: Accounting for non-normality in returns (skewness/kurtosis).
- **Stress Testing Engine**: Scenario analysis for historical crashes (2008, 2020) and custom macroeconomic shocks.

### Financial Machine Learning
Productionizing ML for time-series without the common pitfalls of overfitting.
- **Deep Learning Architectures**: High-fidelity LSTM, GRU, and Transformer models for financial time-series.
- **Purged Cross-Validation**: Preventing information leakage across overlapping time intervals.
- **Feature Engineering Pipeline**: 500+ alpha factors with built-in feature selection (Mutual Information, RF importance).
- **Walk-Forward Validation**: Simulating realistic model retraining and deployment cycles.

### Optimal Execution
Production-grade algorithms to minimize market impact.
- **Standard Algos**: VWAP, TWAP, and Percentage of Volume (POV) with adaptive participation.
- **Implementation Shortfall**: Almgren-Chriss optimal trajectory for risk-averse liquidation.
- **Market Microstructure**: VPIN (Volume-Synchronized Probability of Informed Trading) and LOB dynamics.

---

## Quick Start

### 1. Unified API Access
MeridianAlgo provides a clean "one-stop" API for baseline quantitative tasks.

```python
import meridianalgo as ma

# Fetch data and perform quick analysis
prices = ma.get_market_data(['AAPL', 'MSFT', 'GOOGL'])
returns = prices.pct_change().dropna()

# Get institutional performance metrics
metrics = ma.calculate_metrics(returns['AAPL'])
print(f"Sharpe Ratio: {metrics['sharpe_ratio']:.2f}")

# Generate signals
rsi = ma.calculate_rsi(prices['AAPL'], window=14)
```

### 2. Advanced Portfolio Optimization
```python
from meridianalgo.portfolio import PortfolioOptimizer

# Initialize and optimize using HRP
opt = PortfolioOptimizer(returns)
weights = opt.optimize(method='hrp')

print("Institutional Allocations:")
print(weights.sort_values(ascending=False).head())
```

### 3. Pricing & Greeks (Derivatives)
```python
from meridianalgo.derivatives import BlackScholes, GreeksCalculator

# Calculate BS Price and Delta
price = BlackScholes.call_price(S=100, K=105, T=0.5, r=0.05, sigma=0.2)
delta = GreeksCalculator.delta('call', S=100, K=105, T=0.5, r=0.05, sigma=0.2)
```

---

## Performance Benchmarks
*Tested on Intel i9-12900K, 64GB RAM, Ubuntu 22.04*

| Operation | Scale | Latency | Efficiency |
| :--- | :--- | :--- | :--- |
| Portfolio VaR | 5,000 assets | < 120ms | Optimized Cython/NumPy |
| GARCH(1,1) Fit | 10 years daily | < 250ms | Parallelized Scipy |
| Backtest Engine | 10M events | < 3.2s | Event-driven C-Speed |
| Option Greeks | 500k contracts | < 400ms | Vectorized Broadcasters |

---

## Enterprise Configuration

### Logging & Auditing
Standardized logging for production environments to ensure every trade decision is auditable.
```python
from meridianalgo.utils.logging import setup_logger
logger = setup_logger("prod_trading", log_file="audit.log")
```

### Data Integrity
Automated data validation for high-stakes trading systems.
```python
from meridianalgo.utils.validation import DataValidator
DataValidator.validate_timeseries(raw_data) # Validates index, continuity, and NaNs
```

---

## Documentation
Visit [docs.meridianalgo.com](https://meridianalgo.readthedocs.io) for full API documentation, mathematical derivations, and research notebooks.

---

## Legal Disclaimer
*MeridianAlgo is a research and development platform. Trading financial instruments involves significant risk. The authors provide no warranties and are not responsible for financial losses incurred through the use of this software.*

---

**Built with Love by the Meridian Algorithmic Research Team.**
