How StockView works

Analysis pipeline, data sources and metrics.

Overview

StockView uses a 6-step sequential analysis pipeline. Each step performs a specific task: configuration, data collection, analysis, risk assessment, rebalancing, and final report synthesis.

Risk Profiles

The algorithm adapts to three investor profiles with different risk tolerances and optimization objectives.

Conservative
Risk penalty (λ)2.0
Volatility target<12%

Minimize variance with drawdown penalty. Prioritizes capital preservation.

Moderate
Risk penalty (λ)1.0
Volatility target12-20%

Maximize Sharpe ratio. Balances return and risk.

Aggressive
Risk penalty (λ)0.3
Volatility target>20% tolerated

Maximize return with variance tolerance. Allows higher volatility for upside potential.

Time Horizon Adaptation

The analysis period and metric weights adapt to your investment horizon.

Short-term (<1yr)
Primary focus:Recent trends

40% momentum, 40% volatility, 20% correlation

Medium-term (1-5yr)
Primary focus:Balanced

25% momentum, 45% volatility, 30% correlation

Long-term (>5yr)
Primary focus:Long-term stability

15% momentum, 35% volatility, 50% correlation

The 6-step pipeline

01
Setup

Portfolio parameters

Parses positions and classifies them by region (US, European, crypto equities). Uses exchange suffixes to identify markets.

02
Data & Metrics

Quotes, MPT metrics

Fetches historical prices from Yahoo Finance. Period adapts to investment horizon (3mo/1y/3y). Computes comprehensive metrics: return, volatility, Sharpe, Sortino, CVaR, skewness, kurtosis, momentum, EMA, and profile-optimized weights.

03
Stock Analysis

Technical & fundamental signals

Analyzes each position: RSI, MACD, Bollinger Bands, moving averages, P/E, earnings growth, dividend yield, beta and analyst ratings.

04
Risk Assessment

Risk profile

Evaluates concentration, high correlations, volatility and regional macro risks. Returns a score and LOW / MEDIUM / HIGH classification.

05
Rebalancing

Suggested actions

Proposes REDUCE, INCREASE or MAINTAIN for each position. Uses both min-variance weights (conservative reference) and profile-optimal weights (adapts to investor risk tolerance).

06
Synthesis

Markdown report

Compiles the final report with metrics, technical and fundamental outlook, risk profile and action plan.

Metrics used

Computed on historical daily data from Yahoo Finance. Period adapts to investment horizon: 3mo (short), 1y (medium), 3y (long).

Annualised ReturnΣ(wᵢ × rᵢ) × 252

Weighted average return over the analysis period, annualised.

Annualised Volatility√(w' Σ w) × √252

Portfolio standard deviation via variance-covariance matrix. < 12%: conservative, 12-20%: moderate, > 20%: aggressive.

Sharpe Ratio(return − 4.5%) / volatility

Risk-adjusted return. > 1.0: good, 0.5-1.0: acceptable, < 0.5: insufficient.

Sortino Ratio(return − 4.5%) / downside_dev

Downside risk-adjusted return. Only penalises negative volatility. > 1.0: good.

Max Drawdownmin(Pₜ / max(P) − 1)

Largest peak-to-trough decline over the analysis period.

Downside Deviationstd(losses < 0)

Volatility of only negative returns. Focuses on harmful volatility only.

Daily VaR 95%5th percentile of returns

Maximum expected daily loss 95% of trading days.

Monthly VaR 95%VaR_daily × √21

Estimated monthly VaR from daily VaR.

Monthly CVaR 95%mean(losses | loss > VaR)

Average loss on the worst 5% of days. More informative than VaR alone.

SkewnessE[(R−μ/σ)³]

Asymmetry of return distribution. > 0.5: positive (occasional big gains). < −0.5: negative (occasional big losses).

KurtosisE[(R−μ/σ)⁴]

Tail heaviness. > 3: fat tails (more extreme events). < 3: light tails.

Effective N1 / Σ(wᵢ²)

Concentration index. < 3.0: concentrated portfolio.

Min-Variance Volatility√(w*' Σ w*)

Volatility theoretically achievable with minimum-variance rebalancing.

Min-Variance WeightsSLSQP optimisation

Allocation that minimises portfolio variance. Conservative reference.

Profile-Optimal WeightsSLSQP with λ by profile

Allocation optimised for investor profile. λ varies: conservative (2.0), moderate (1.0), aggressive (0.3).

Momentum(Pₜ / Pₜ₋ₙ) − 1

Price momentum over 20/60/120 days. Positive = bullish trend. Weighted by time horizon.

Exponential Moving Average (EMA)EMAₜ = α×Pₜ + (1-α)×EMAₜ₋₁

Smoothed price indicators for 20/50/200 day spans. Above price = bullish, below = bearish.

Top CorrelationsPearson r on daily returns

Most correlated pairs. |r| > 0.75: near-redundant positions.

Data sources

Yahoo Finance

Live market data: quotes, OHLCV, P/E, beta, analyst ratings, dividend yield. ~15 min delay. No API key required.

Financial news

News headlines per symbol from Yahoo Finance.

Macro data

Via regional proxy ETFs (SPY, EZU, EEM, etc.).

Known limitations

  • ·Prices are delayed ~15 minutes via Yahoo Finance.
  • ·Monthly VaR uses √21 — real losses can exceed the estimate.
  • ·Macro analysis uses ETF proxies, not dedicated economic data.
  • ·Correlations on less than 252 days may be less stable.
  • ·The pipeline runs once per submission, no real-time updates.