Leversens
The algorithm

How it works, end to end

Six steps, every month. Click any step below to expand its details, or dive into a dedicated explainer.

Monthly pipeline

From raw filings to live signals

Click any step to see the details. Hover the connectors to follow the flow.

1 📥
Pull data
EDGAR + Yahoo Finance
Click to expand ↓

Pull fundamentals + prices

  • Each month, fetch the latest 10-K filings from SEC EDGAR companyfacts API for every ticker in our investable universe — a Russell 3000 approximation (~3,000 largest US firms by market cap, NASDAQ + NYSE).
  • Daily adjusted closes for the past 800 days from Yahoo Finance, for momentum and beta calculations.
  • Cached locally for 30 days to avoid hitting rate limits — only the deltas are re-pulled monthly.
Read full explainer
2 ⚖️
Score quality
13 ratios → z-score
Click to expand ↓

Compute composite quality score

  • Profitability (6 ratios): gross profit / assets, ROE, ROA, operating cash flow / assets, gross margin, accruals.
  • Growth: 5-year change in each profitability ratio.
  • Safety: Altman Z-score components + Piotroski-like liquidity ratios + inverted leverage.
  • Cross-sectional rank z-score at each level, then composite = z(mean of three pillars).
Read full explainer
3 🚀
Filter momentum
12-1 month, > median
Click to expand ↓

Apply academic momentum filter

  • Cumulative return over [t-252, t-21] days — 12 months excluding the last month (avoids short-term reversal noise).
  • Keep only stocks with momentum > 0 AND > cross-sectional median.
  • Typically eliminates 40-60% of the top quality decile.
Read full explainer
4 🛡️
Check regime
Trailing 3M ret > 0?
Click to expand ↓

Test the regime indicator

  • If the strategy's own trailing 3-month return is positive → FULL exposure (100% invested).
  • If negative → HALF exposure (50% in cash, 50% in top picks).
  • Endogenous, non-discretionary — a built-in circuit breaker.
Read full explainer
5 📊
Build weights
Top decile, max 40
Click to expand ↓

Construct the portfolio

  • Drop firms flagged insolvent by Altman Z-score (Z < 1.81).
  • Take the top decile by composite quality.
  • Cap at 40 positions max for diversification.
  • Weights proportional to quality score, normalized to 100%.
Read full explainer
6 📧
Send briefing
Email + site update
Click to expand ↓

Notify subscribers and refresh the site

  • Commit fresh live.json + history.json to GitHub repo (auto-deploys to Vercel within 60s).
  • Trigger a broadcast email via Resend to all newsletter subscribers — branded from noreply@leversenstrading.com.
  • Each user gets the full picture: regime, holdings, buys/sells, performance.
Read full explainer