Correlation Matrix ?
Pearson correlation matrix for 2-10 symbols over a selected time period. Shows pairwise correlations from -1 (perfectly inverse) to +1 (perfectly correlated). Useful for portfolio diversification analysis and identifying hedging relationships. Includes a formatted heatmap-style text output.
ka corr-matrix -s TSLA,AAPL,MSFT,NVDA,GOOGL
▶ Run
ka corr-matrix -s SPY,QQQ,IWM,DIA
▶ Run
ka corr-matrix -s TSLA,GLD,TLT,SPY
▶ Run
ka corr-matrix -s AAPL,MSFT,GOOGL,META,AMZN -tf 2y
▶ Run
ka corr-matrix -s BTCUSD,ETHUSD,SPY,GLD
▶ Run
ka corr-matrix -s XOM,CVX,COP,SLB -tf 1y
▶ Run
ka corr-matrix -s TSLA,RIVN,NIO,LCID
▶ Run
ka corr-matrix -s AAPL,MSFT,NVDA,TSLA,GOOGL,META,AMZN -output json
▶ Run
Multi-Symbol Comparison ?
Side-by-side comparison of 2-10 symbols across key metrics: returns (1d/1m/3m/1y), volatility, Sharpe ratio, beta vs SPY, RSI, ADX, max drawdown, and market cap. Output is a formatted comparison table. Ideal for peer analysis, ETF comparison, and portfolio candidate screening.
ka compare -s AAPL,MSFT,GOOGL,META,AMZN
▶ Run
ka compare -s TSLA,RIVN,NIO,LCID
▶ Run
ka compare -s SPY,QQQ,IWM,DIA,GLD,TLT
▶ Run
ka compare -s TSLA,AAPL -tf 2y
▶ Run
ka compare -s JPM,BAC,WFC,GS,MS
▶ Run
ka compare -s BTCUSD,ETHUSD,GLD,SPY
▶ Run
ka compare -s NVDA,AMD,INTC,TSM
▶ Run
ka compare -s AAPL,MSFT,GOOGL,AMZN -output json
▶ Run
Cross-Sectional Dispersion ?
Cross-sectional dispersion measuring how spread out returns are within a basket. High dispersion = stock-picking market (alpha opportunity), low dispersion = macro-driven / correlated (trade the index instead). Computes daily cross-sectional standard deviation, rolling dispersion (20d default), current percentile vs historical range, per-symbol deviation from basket mean (outlier detection), dispersion regime (HIGH/NORMAL/LOW/VERY_LOW), and average pairwise correlation.
ka dispersion -s TSLA,NVDA,AAPL,MSFT,META,AMZN,GOOGL
▶ Run
ka dispersion -s XLK,XLF,XLE,XLV,XLI,XLP -period 1y
▶ Run
ka dispersion -s NVDA,AMD,AVGO,TSM,QCOM -window 30
▶ Run
ka dispersion -s SPY,QQQ,IWM,DIA -period 2y
▶ Run
ka dispersion -s JPM,BAC,WFC,GS,MS -period 6m
▶ Run
ka dispersion -s TSLA,RIVN,NIO,LCID
▶ Run
ka dispersion -s AAPL,MSFT,GOOGL,META,AMZN -output json
▶ Run
ka dispersion -s BTC-USD,ETH-USD,SOL-USD -period 6m
▶ Run
Lead-Lag Analysis ?
Cross-correlation at various lags (1-5 days) between all pairs in a basket. Finds predictive relationships: does AMD move before NVDA? Does SPY lead the group or follow? Returns a lead-lag matrix with strongest predictive pairs highlighted, per-pair optimal lag and correlation at that lag, leader/follower ranking (who leads the most pairs), and Granger-style directional score per symbol.
ka lead-lag -s NVDA,AMD,TSLA,AAPL,SPY
▶ Run
ka lead-lag -s SPY,QQQ,IWM,DIA -period 1y
▶ Run
ka lead-lag -s NVDA,AMD,TSM,AVGO -max_lag 3
▶ Run
ka lead-lag -s TSLA,RIVN,NIO -period 6m
▶ Run
ka lead-lag -s JPM,BAC,WFC,GS -period 1y
▶ Run
ka lead-lag -s BTC-USD,ETH-USD,SPY -period 1y
▶ Run
ka lead-lag -s XOM,CVX,COP,SLB
▶ Run
ka lead-lag -s NVDA,AMD,TSLA,AAPL -output json
▶ Run
Cross-Sectional Herding ?
Cross-sectional herding & dispersion analysis — daily dispersion (std of returns across symbols), Cross-Sectional Absolute Deviation (CSAD), directional agreement %, percentage of macro-driven days (>=80% agreement) vs stock-picking days (<=60% agreement), and recent regime detection (MACRO-DRIVEN vs STOCK-PICKING).
ka herding -s NVDA,AMD,TSLA,AAPL,MSFT
▶ Run
ka herding -s XLE,XLF,XLK,XLV,XLI,XLU
▶ Run
ka herding -s JPM,BAC,GS,MS,C
▶ Run
ka herding -s SPY,QQQ,IWM,DIA
▶ Run
Spread Trading Analysis ?
Price ratio tracking between 2-3 symbols for relative value monitoring. Shows ratio mean, current z-score, Bollinger Bands on the ratio, and reversion signals. Simpler than the full pairs command (no cointegration or hedge ratios) — focuses on the raw price ratio with band analysis for quick relative value assessment and spread reversion signals.
ka spread -s TSLA,NVDA
▶ Run
ka spread -s AAPL,MSFT -period 2y
▶ Run
ka spread -s KO,PEP -period 1y
▶ Run
ka spread -s XOM,CVX
▶ Run
ka spread -s GLD,SLV -bb_window 30
▶ Run
ka spread -s NVDA,AMD -bb_mult 2.5
▶ Run
ka spread -s SPY,QQQ -period 1y
▶ Run
ka spread -s TSLA,NVDA -output json
▶ Run
Pairs Trading Analysis ?
Quantitative pairs trading analysis for two symbols. Computes hedge ratio via OLS regression, spread statistics, rolling z-score (current divergence from mean), ADF cointegration test with p-value, half-life of mean reversion, correlation, historical spread extremes, and entry/exit signals at configurable z-score thresholds. Supports log-price and raw-price spread types. Essential for statistical arbitrage and market-neutral strategies.
ka pairs -s TSLA,RIVN
▶ Run
ka pairs -s NVDA,AMD
▶ Run
ka pairs -s AAPL,MSFT -lookback 500
▶ Run
ka pairs -s KO,PEP
▶ Run
ka pairs -s XOM,CVX -entry_z 2.5
▶ Run
ka pairs -s GOOGL,META -spread_type price
▶ Run
ka pairs -s GLD,GDX
▶ Run
ka pairs -s TSLA,RIVN -output json
▶ Run
Cross-Asset Performance Curve ?
Cross-asset performance curve — multi-symbol normalized cumulative returns from 100, side-by-side total return / vol / max drawdown, relative outperformance vs first symbol over time, and snapshots at start/quartiles/end.
ka curve -s SPY,QQQ,IWM,DIA
▶ Run
ka curve -s SPY,TLT,GLD
▶ Run
ka curve -s NVDA,AMD,AVGO,QCOM,INTC
▶ Run
ka curve -s XLE,XLF,XLK,XLV -period 6m
▶ Run
Performance Heatmap ?
Multi-symbol performance heatmap across timeframes. Shows returns for each symbol across 1-day, 1-week, 1-month, 3-month, 6-month, YTD, and 1-year periods in an ASCII color-coded table. Provides at-a-glance comparison of which symbols are leading or lagging across all timeframes. Ideal for sector comparison, portfolio review, and identifying momentum leaders and laggards in a basket.
ka heatmap -s AAPL,MSFT,NVDA,TSLA,GOOGL,META,AMZN
▶ Run
ka heatmap -s XLK,XLF,XLE,XLV,XLI,XLP,XLU
▶ Run
ka heatmap -s SPY,QQQ,IWM,DIA,GLD,TLT
▶ Run
ka heatmap -s TSLA,RIVN,NIO,LCID
▶ Run
ka heatmap -s JPM,BAC,WFC,GS,MS,C
▶ Run
ka heatmap -s NVDA,AMD,TSM,AVGO,QCOM
▶ Run
ka heatmap -s BTC-USD,ETH-USD,SOL-USD,ADA-USD
▶ Run
ka heatmap -s AAPL,MSFT,NVDA,TSLA -output json
▶ Run
Relative Rotation Graph ?
Relative Rotation Graph (RRG) analysis placing each symbol in one of 4 quadrants based on JdK RS-Ratio (relative strength vs benchmark, normalized to 100) and JdK RS-Momentum (rate of change of RS-Ratio). Quadrants: LEADING (outperforming & accelerating), WEAKENING (outperforming but decelerating), LAGGING (underperforming & decelerating), IMPROVING (underperforming but accelerating). Shows the clockwise rotation path and identifies which symbols are entering leadership.
ka relative-rotation -s NVDA,AMD,AVGO,QCOM,INTC
▶ Run
ka relative-rotation -s XLK,XLF,XLE,XLV,XLI,XLP -benchmark SPY
▶ Run
ka relative-rotation -s AAPL,MSFT,GOOGL,META,AMZN
▶ Run
ka relative-rotation -s TSLA,RIVN,NIO,LCID -benchmark QQQ
▶ Run
ka relative-rotation -s SPY,QQQ,IWM,DIA -benchmark SPY
▶ Run
ka relative-rotation -s JPM,BAC,WFC,GS,MS
▶ Run
ka relative-rotation -s XOM,CVX,COP,SLB -lookback 500
▶ Run
ka relative-rotation -s NVDA,AMD,AVGO,TSM -output json
▶ Run
Basket Performance Tracker ?
Basket performance tracker computing cumulative equal-weight or custom-weighted basket return over time. Like a mini-fund NAV with daily P&L attribution showing which symbols contributed most and least. Includes rolling Sharpe ratio, max drawdown, best/worst contributor per period, and correlation between basket members. Ideal for tracking thematic baskets, sector groups, or custom portfolios.
ka basket -s AAPL,MSFT,GOOGL,TSLA,NVDA
▶ Run
ka basket -s AAPL,MSFT,GOOGL,TSLA,NVDA -weights 0.3,0.2,0.2,0.15,0.15
▶ Run
ka basket -s NVDA,AMD,TSM,AVGO,QCOM -period 1y
▶ Run
ka basket -s SPY,QQQ,GLD,TLT -period 2y
▶ Run
ka basket -s TSLA,RIVN,NIO,LCID -period 6m
▶ Run
ka basket -s JPM,BAC,WFC,GS,MS -period 1y
▶ Run
ka basket -s BTC-USD,ETH-USD,SOL-USD -period 6m
▶ Run
ka basket -s AAPL,MSFT,NVDA,TSLA -output json
▶ Run
Factor Exposure Analysis ?
Multi-factor exposure analysis for 1-10 symbols across five dimensions: Momentum (3m/6m/12m returns, RSI, relative strength), Value (P/E, P/B, EV/EBITDA, dividend yield), Quality (ROE, net margin, operating margin, debt/equity), Size (market cap, rank within group), and Volatility (annualized vol, beta proxy, max drawdown). Scores each factor 1-5 within the group (quintile rank), computes a composite score, and shows a factor radar profile.
ka factor -s TSLA,NVDA,AAPL,MSFT,META
▶ Run
ka factor -s SPY,QQQ,IWM,DIA
▶ Run
ka factor -s JPM,BAC,WFC,GS,MS
▶ Run
ka factor -s NVDA,AMD,TSM,AVGO,QCOM
▶ Run
ka factor -s AAPL,MSFT,GOOGL,AMZN
▶ Run
ka factor -s XOM,CVX,COP,SLB
▶ Run
ka factor -s TSLA,RIVN,NIO,LCID
▶ Run
ka factor -s AAPL,MSFT,NVDA,TSLA -output json
▶ Run
Covariance Matrix ?
Variance-covariance matrix with eigenvalue decomposition for 2-10 symbols. Returns the full covariance matrix, correlation matrix, explained variance by principal components (PCA), diversification ratio, and flags indicating diversification quality. Shows how much of the basket's risk is driven by the first few factors. Essential for portfolio construction, risk budgeting, and understanding concentration risk.
ka covariance -s NVDA,AMD,TSLA,AAPL,MSFT
▶ Run
ka covariance -s SPY,QQQ,GLD,TLT -period 2y
▶ Run
ka covariance -s AAPL,MSFT,GOOGL,META,AMZN -period 1y
▶ Run
ka covariance -s JPM,BAC,WFC,GS -period 1y
▶ Run
ka covariance -s XOM,CVX,COP -period 6m
▶ Run
ka covariance -s TSLA,RIVN,NIO -period 1y
▶ Run
ka covariance -s BTC-USD,ETH-USD,SPY,GLD
▶ Run
ka covariance -s NVDA,AMD,TSLA,AAPL -output json
▶ Run
Beta Analysis ?
Beta analysis vs a benchmark (default: SPY). Reports beta, alpha, R-squared, correlation, and tracking error over multiple timeframes. Includes rolling beta chart to show how beta has changed over time. Useful for understanding a stock's systematic risk and market sensitivity.
ka beta -s TSLA
▶ Run
ka beta -s AAPL
▶ Run
ka beta -s TSLA -b QQQ
▶ Run
ka beta GLD -b SPY
▶ Run
ka beta -s TSLA -tf 2y
▶ Run
Style Box Positioning ?
Style box positioning — places each stock on a 3x3 grid of Size (Small/Mid/Large) × Style (Value/Blend/Growth) using market cap, P/E, P/B, and 12-month momentum as factor inputs. Lighter-weight version of the factor command focused specifically on style classification.
ka tilt -s AAPL,MSFT,GOOGL,TSLA,NVDA
▶ Run
ka tilt -s SPY,QQQ,IWM
▶ Run
ka tilt -s JPM,BAC,GS
▶ Run
ka tilt -s NVDA,AMD,AVGO,QCOM,INTC
▶ Run
Signal Dashboard ?
Aggregate technical signal scan across a watchlist. For each symbol: RSI zone (overbought/neutral/oversold), MACD signal (bullish/bearish crossover), MA alignment (bullish/bearish stack), ADX trend strength, and a net signal score. One table showing which names have the most bullish or bearish signal confluence. Ideal for quickly scanning a watchlist to find the strongest and weakest names.
ka signal-dashboard -s TSLA,NVDA,AAPL,MSFT,META
▶ Run
ka signal-dashboard -s NVDA,AMD,TSM,AVGO,QCOM,INTC
▶ Run
ka signal-dashboard -s SPY,QQQ,IWM,DIA,GLD,TLT
▶ Run
ka signal-dashboard -s TSLA,RIVN,NIO,LCID
▶ Run
ka signal-dashboard -s JPM,BAC,WFC,GS,MS,C
▶ Run
ka signal-dashboard -s XOM,CVX,COP,SLB,EOG
▶ Run
ka signal-dashboard -s AAPL,MSFT,GOOGL,META,AMZN,NVDA,TSLA
▶ Run
ka signal-dashboard -s TSLA,NVDA,AAPL,MSFT -output json
▶ Run
Factor Predictive Power Test ?
Tests the predictive power of a factor across a basket. Computes daily Spearman rank IC (Information Coefficient) between factor at t and forward N-day return at t+N, IR (mean/std of IC), hit rate, and runs a quintile NAV simulation rebalanced daily. The Q-top minus Q-bottom long-short return is the canonical alpha measure. Different from `factor` (which scores known factors) — this validates whether ANY metric has predictive power on YOUR universe. Supported factors include returns (return_1d/1w/1m/3m/6m/1y), oscillators (rsi9/14/20), volatility (stdev_20d/50d, atr14, natr14), trend (adx14), MA distance (close_to_sma20/50/200_percentage), and volume (volume_relative_20d/60d).
ka factor-test -s NVDA,AMD,AVGO,QCOM,INTC,TSM,MU -factor rsi14
▶ Run
ka factor-test -s AAPL,MSFT,GOOGL,AMZN,META,NVDA,TSLA -factor return_1m -horizon 20
▶ Run
ka factor-test -s SPY,QQQ,IWM,DIA,XLK,XLF,XLE,XLV -factor adx14
▶ Run
ka factor-test -s NVDA,AMD,AVGO,QCOM,INTC,TSM,MU,LRCX,KLAC -factor close_to_sma200_percentage -horizon 5
▶ Run
ka factor-test -s NVDA,AMD,AVGO,QCOM,INTC -factor return_3m -groups 3
▶ Run
ka factor-test -s AAPL,MSFT,GOOGL,AMZN,META,NVDA,TSLA -factor volume_relative_20d
▶ Run
ka factor-test -s NVDA,AMD,AVGO,QCOM,INTC,TSM,MU -factor stdev_20d -horizon 10
▶ Run
ka factor-test -s SPY,QQQ,IWM,DIA,XLK,XLF -factor return_3m -horizon 20 -period 2y
▶ Run
Copula Tail Dependence ?
Tail dependence analysis via Student-t copula fitting. Pearson correlation misses tail co-movement — this quantifies whether assets crash (or rally) together more than linear correlation implies. Fits t-copula parameters (correlation rho, degrees of freedom nu) via maximum pseudo-likelihood, then computes upper and lower tail dependence coefficients. Compares with Gaussian copula baseline (zero tail dependence). Critical for understanding portfolio risk during market stress.
ka copula -s TSLA,NVDA
▶ Run
ka copula -s AAPL,MSFT,GOOGL,META,AMZN
▶ Run
ka copula -s SPY,GLD,TLT -tf 5y
▶ Run
ka copula -s NVDA,AMD,TSM,AVGO
▶ Run
ka copula -s BTC-USD,ETH-USD,SPY
▶ Run
ka copula -s JPM,BAC,WFC,GS -tf 3y
▶ Run
ka copula -s TSLA,RIVN,NIO -tf 2y
▶ Run
ka copula -s AAPL,MSFT,NVDA,TSLA -output json
▶ Run