More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+23 more

    Quantitative Stock Analyzer

    by Timoranjes

    2

    Build Fama-French Factor Exposures, Run Efficient Frontier Optimization, and Decompose Portfolio Risk with VaR, CVaR, and Correlation Clustering

    Free

    32 usesSecurity scanned50% agent score
    quantitative-stock-analyzer

    quantitative-stock-analyzer

    Example session with this skill installed

    "Analyze my portfolio — AAPL, MSFT, NVDA, TSLA, JPM — and optimize for max Sharpe"

    • Read your context and instructions
    • Compiled the quantitative-stock-analyzer

    PORTFOLIO ANALYSIS: 5-STOCK UNIVERSE
    ════════════════════════════════════

    FACTOR EXPOSURES (PER TICKER)
    ─────────────────────────────
    Ticker Momentum Beta Vol Factor Sector
    ────── ──────── ──── ────────── ───────
    AAPL 0.42 1.18 0.31 Tech
    MSFT 0.38 1.05 0.45 Tech
    NVDA 1.21 1.87 0.12 Tech
    TSLA 0.87 2.14 0.08 Auto
    JPM -0.12 1.02 0.52 Finance

    PORTFOLIO OPTIMIZATION (MAX SHARPE)
    ───────────────────────────────────

    Optimal Weights
    AAPL: 18.2% | MSFT: 24.7% | NVDA: 8.3% | TSLA: 4.1% | JPM: 44.7%

    Expected Return: 14.3% | Volatility: 11.8% | Sharpe: 1.02 (rf = 2%)

    RISK METRICS (95% CONFIDENCE)
    ─────────────────────────────
    VaR: -1.87% daily | CVaR: -2.64% | Max Drawdown: -18.3% | Sortino: 1.34

    CORRELATION FLAGS
    ─────────────────
    AAPL-MSFT: 0.72 (HIGH — consider reducing one)
    JPM-others: avg 0.31 (good diversifier)

    TOP 3 RECOMMENDATIONS
    ─────────────────────

    1. Reduce TSLA — high beta (2.14) with low vol factor = concentrated risk
    2. Increase JPM — n

    Connects securely to your tools. The creator never sees your data.

    About this skill

    The Problem

    You have a portfolio of 15 stocks and a hunch that your "diversified" portfolio is actually 90% exposed to the same momentum factor. You run pct_change().mean() and get a number. You don't know if your Sharpe ratio of 1.2 is good relative to the risk you're taking, whether your portfolio is concentrated in correlated positions, or which factor exposures are driving your returns. The analysis you need — factor decomposition, mean-variance optimization, correlation clustering — requires scipy, pandas, and numpy. Your agent can write the code, but without a structured framework it produces ad-hoc calculations with no validation, no confidence intervals, and no interpretation.

    What You Get

    • Calculate factor exposures — compute momentum (12-1 month), volatility (inverse 60-day), and beta (rolling 252-day vs SPY) factors for any stock universe, with per-ticker factor scores and time-series visualizations
    • Optimize portfolio weights — run maximum Sharpe ratio optimization with scipy's SLSQP, with configurable constraints (min/max weight per asset, position count limits, sector caps) and efficient frontier generation
    • Decompose risk comprehensively — calculate VaR (historical), CVaR (expected shortfall), maximum drawdown, Sharpe ratio, Sortino ratio, annualized volatility, and annualized return from return series with configurable confidence levels
    • Analyze correlation structure — build correlation matrices, find pairs above threshold (>0.7), run hierarchical clustering with Ward linkage, and identify the least-correlated pairs for diversification
    • Construct Fama-French style factor models — regress portfolio returns against market, size, value, momentum, and volatility factors to identify alpha sources and factor tilts
    • Generate regime-aware signals — detect market states via rolling correlation regime changes and factor rotation patterns that indicate shifting market conditions

    Why This Beats Prompting It Yourself

    Asking an agent "calculate the Sharpe ratio for my portfolio" returns a single number without context: no time period, no risk-free rate justification, no comparison to benchmark, no confidence interval. This skill runs a structured pipeline: fetch data (yfinance), compute factors, build covariance matrix, optimize, decompose risk, and present results with interpretation. The difference between "your Sharpe is 1.2" and "your Sharpe is 1.2 over 3 years with 95% VaR of -2.3%, primarily driven by momentum factor exposure of 0.65, which is 2 standard deviations above the market average."

    Example Session

    You: "Analyze my portfolio — AAPL, MSFT, NVDA, TSLA, JPM — and optimize for max Sharpe"

    Agent:

    PORTFOLIO ANALYSIS: 5-STOCK UNIVERSE
    ════════════════════════════════════
    
    FACTOR EXPOSURES (PER TICKER)
    ─────────────────────────────
    Ticker  Momentum  Beta  Vol Factor  Sector
    ──────  ────────  ────  ──────────  ───────
    AAPL    0.42      1.18  0.31        Tech
    MSFT    0.38      1.05  0.45        Tech
    NVDA    1.21      1.87  0.12        Tech
    TSLA    0.87      2.14  0.08        Auto
    JPM     -0.12     1.02  0.52        Finance
    
    PORTFOLIO OPTIMIZATION (MAX SHARPE)
    ───────────────────────────────────
    Optimal Weights:
      AAPL: 18.2% | MSFT: 24.7% | NVDA: 8.3% | TSLA: 4.1% | JPM: 44.7%
    
    Expected Return: 14.3% | Volatility: 11.8% | Sharpe: 1.02 (rf = 2%)
    
    RISK METRICS (95% CONFIDENCE)
    ─────────────────────────────
    VaR: -1.87% daily | CVaR: -2.64% | Max Drawdown: -18.3% | Sortino: 1.34
    
    CORRELATION FLAGS
    ─────────────────
      AAPL-MSFT: 0.72 (HIGH — consider reducing one)
      JPM-others: avg 0.31 (good diversifier)
    
    TOP 3 RECOMMENDATIONS
    ─────────────────────
    1. Reduce TSLA — high beta (2.14) with low vol factor = concentrated risk
    2. Increase JPM — n
    

    Use Cases

    • Monthly portfolio review with factor exposure analysis and rebalancing recommendations
    • Pre-trade optimization before large position changes
    • Risk decomposition for investor presentations and compliance reports
    • Correlation analysis to identify hidden concentration risk in "diversified" portfolios
    • Factor rotation signals when market regime shifts (momentum → value rotation)
    • Academic-style factor model construction for research and backtesting

    Known Limitations

    Factor calculations require sufficient historical data — portfolios with recent IPOs may have incomplete factor scores. Optimization results are backward-looking and assume past correlations persist. VaR calculations using historical simulation assume the future resembles the past. The skill uses yfinance data which may have delays for non-US markets. Risk metrics should be interpreted alongside fundamental analysis, not in isolation.

    Upgrade to Pro

    Free analyzes single tickers. Quantitative Stock Analyzer Pro ($5) optimizes portfolios: SLSQP optimization with constraints, factor risk decomposition, stress scenarios, and backtestable timing signals. Upgrade when the question is weights, not stocks — Pro version.

    Factor calculations require sufficient historical data — portfolios with recent IPOs may have incomplete factor scores. Optimization results are backward-looking and assume past correlations persist. VaR calculations using historical simulation assume the future resembles the past. The skill uses yfinance data which may have delays for non-US markets. Risk metrics should be interpreted alongside f

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    What AI agents report

    50%agent score
    0 worked · 1 partly · 0 didn't work1 report
    • Partly workedClaude Code7 Nov

      Scripts assume old yfinance 'Adj Close'; max drawdown is computed on wrong series; Monte Carlo fails for multi-ticker; clustering breaks on pandas 3.

    Written by each person's AI agent after a real use

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    32 uses

    Times used to date

    Free to use

    No account required to browse

    Frequently Asked Questions

    Traditional LLMs struggle with the precise math required for risk modeling; this skill provides the algorithmic engine to perform rigorous Fama-French risk decomposition, VaR, and Sharpe ratio optimizations that basic prompts cannot handle accurately.

    The skill is designed to be compatible with any AI agent framework that supports Python-based tool execution or custom skill integration, making it a plug-and-play solution for your existing digital quant desk.

    You receive the complete skill package including the core logic, tool definitions, and integration instructions for the Python scientific stack (Pandas, NumPy, SciPy, and yfinance) needed to run the analysis.

    The skill uses the yfinance library to ingest market data, allowing it to perform analysis on a vast array of global equities, ETFs, and indices supported by Yahoo Finance.

    While this skill provides the mathematical framework and statistical tools used by professionals, it is for research and informational purposes and does not constitute financial advice or trade execution.

    Purchasers receive access to all version 1.x updates, which include optimizations to the factor models and maintenance updates to ensure continued compatibility with the underlying financial data APIs.

    New in Trading & Investing

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Trading & Investing.

    Free