--- name: fin-guru-quant-analysis description: "Quantitative analysis of tickers or the portfolio through the engine's calculators. Covers risk metrics (VaR, CVaR, Sharpe, Sortino, drawdown, beta), momentum, volatility regime, correlation, factor models, backtests, and portfolio optimization. Use when the owner asks how risky a holding is, wants risk or return statistics, compares tickers on risk, asks for an optimal allocation, or wants a strategy backtested. Not for news and catalysts (use fin-guru-research) or buy and sell decisions (use fin-guru-strategize)." --- # Quantitative Analysis Skill Execute structured quantitative analysis workflows with statistical validation. ## Capability probe Before collecting external fundamentals or filings, follow the shared **[paid MCP capability probe](../_shared/PaidMcpCapabilityProbe.md)**. This workflow wants `financial-datasets` for normalized statements and filing data. If it is absent, state whether primary-source `WebSearch` can support the requested model with extra validation; otherwise stop and name the missing MCP and setup action. ## Workflow Steps 1. **Plan** — Define statistical modeling objectives, metrics, and assumptions 2. **Data Validation** — Use `data_validator_cli.py` for statistical validity (outliers, gaps, splits) 3. **Risk Metrics** — Use `risk_metrics_cli.py` for VaR/CVaR/Sharpe/Sortino/Drawdown (minimum 90 days) 4. **Momentum Analysis** — Use `momentum_cli.py` for confluence analysis 5. **Volatility Metrics** — Use `volatility_cli.py` for regime analysis 6. **Correlation Analysis** — Use `correlation_cli.py` for diversification and covariance matrices 7. **Factor Analysis** — Use `factors_cli.py` for Fama-French 3-factor, Carhart 4-factor models 8. **Strategy Validation** — Use `backtester_cli.py` with transaction costs and realistic slippage 9. **Portfolio Optimization** — Use `optimizer_cli.py` for mean-variance, risk parity, max Sharpe, Black-Litterman ## CLI Commands ```bash # Risk metrics uv run python -m src.analysis.risk_metrics_cli TICKER --days 252 --benchmark SPY --output json # Momentum confluence uv run python -m src.utils.momentum_cli TICKER --days 90 --output json # Volatility regime uv run python -m src.utils.volatility_cli TICKER --days 90 --output json # Correlation matrix uv run python -m src.analysis.correlation_cli TICKER1 TICKER2 --days 90 --output json # Factor analysis uv run python -m src.analysis.factors_cli TICKER --days 252 --benchmark SPY --output json # Backtesting uv run python -m src.strategies.backtester_cli TICKER --days 252 --strategy rsi --output json # Portfolio optimization uv run python -m src.strategies.optimizer_cli TICKERS --days 252 --method max_sharpe --output json ``` ## Output Return the [`fin-guru-output-contract`](../fin-guru-output-contract/SKILL.md) skill. In the Numbers table, give each metric its lookback window, such as `Sharpe (252d)`. When fewer than 90 days of data exist, return the Blocked block from that skill instead of a statistic. ## Requirements - Start with clear statistical plan and obtain consent before execution - Validate all assumptions against compliance policies - Apply robust methods with proper confidence intervals - All market data must be timestamped and verified against current date - Minimum 90 days of data for robust statistics