Analyze mean-reversion opportunities across ETFs with Sourcetable AI. Calculate z-scores, identify entry signals, and backtest strategies instantly—no complex formulas required.
Andrew Grosser
February 16, 2026 • 14 min read
March 13, 2020: SPY closes at $254.86, z-score -3.1 (3.1 standard deviations below mean). Extreme oversold. Mean-reversion traders buy. Fifteen days later: SPY at $285.70, up 12.1%. This is mean reversion—prices returning to statistical averages after extreme moves.
Excel makes this tedious: calculating 50-day averages with AVERAGE(), standard deviations with STDEV.P(), z-scores with nested formulas, screening 11 sector ETFs simultaneously. Backtesting different thresholds means rebuilding models manually. Sourcetable eliminates this. Upload ETF data, ask "Which ETFs have z-scores below -2.0?" Get instant calculations and ranked opportunities. Start analyzing mean reversion for free at sign up free.
Mean reversion depends on accurate z-score calculation—measuring how many standard deviations the current price sits from its moving average. A z-score of -2.0 means the ETF trades 2 standard deviations below average (statistically oversold), while +2.0 means 2 standard deviations above (overbought). Getting this calculation right is everything.
Here's what proper z-score analysis requires:
Rolling moving average calculation: You need AVERAGE() applied to the most recent N periods (typically 20, 50, or 200 days). In Excel, that's writing =AVERAGE(B2:B51) in cell C52, then dragging down for 500+ rows. Miss one cell and your entire calculation chain breaks.
Rolling standard deviation: Calculate price volatility over the same N-period window using STDEV.P(). This measures how much prices typically fluctuate around the average. More volatile ETFs (like QQQ) have larger standard deviations than stable ones (like XLU utilities).
Z-score formula: (Current Price - Moving Average) / Standard Deviation. This normalizes price deviation by volatility, making comparisons meaningful across different ETFs. A $5 move means something different for $150 QQQ versus $450 SPY—z-scores standardize the measurement.
Multi-ETF screening: You're not analyzing one ETF. You're screening 11 sector SPDRs (XLF, XLE, XLK, XLV, XLI, XLU, XLP, XLY, XLB, XLRE, XLC) to find which currently shows extreme statistical deviation. That's 11 separate worksheets or a massive table with complex array formulas.
Historical signal identification: Once z-scores are calculated, you need to flag entry signals (z-score crosses below -2.0), exit signals (returns above -0.5), and track signal pairs to calculate individual trade returns. This requires helper columns with nested IF statements checking multiple conditions.
Backtest validation: Before risking money, you need to test historically: How many trades occurred? What was the win rate? Average return? Maximum drawdown? This means tracking every signal pair, calculating returns, and aggregating statistics across potentially 100+ trades.
In Excel, you're building models with 8-10 columns per ETF: Date, Close, MA(50), StdDev(50), Z-Score, Buy_Signal, Sell_Signal, Trade_Return, Cumulative_Return. Multiply that by 11 ETFs and you're managing 88-110 columns. One formula error—wrong cell reference, incorrect STDEV.P range, misaligned rows after data updates—and your signals are wrong. You won't know until you've made bad trades.
Even worse: parameter optimization. Does a 20-day lookback work better than 50-day? Should you enter at z-score -1.8 or -2.2? Testing each variation means rebuilding formulas and recalculating everything. Testing 5 lookback periods × 4 entry thresholds × 3 exit targets = 60 different backtests. In Excel, that's days of work.
Sourcetable handles this entire analytical process through natural language. Upload price data and ask: "Calculate 50-day z-scores for SPY, QQQ, IWM, and all sector ETFs." Done instantly—all statistical measures computed across all ETFs. Request: "Show me which ETFs currently have z-scores below -2.0." The AI scans results and presents oversold candidates ranked by deviation magnitude. Want to optimize? Ask: "Backtest this strategy with 20-day, 50-day, and 200-day lookbacks—show me which produces the best risk-adjusted returns." You get comprehensive parameter analysis in 2 minutes instead of 2 days.
Mean-reversion strategies make money by identifying temporary price dislocations—moments when ETFs trade far from their statistical average—and betting on reversion back toward the mean. The key is defining "far enough" to signal high-probability reversion while avoiding false signals in trending markets.
What z-score threshold defines an entry signal?
The -2.0 standard deviation threshold is most common: Statistically, prices should only trade 2+ standard deviations from the mean about 5% of the time (2.5% on each tail in a normal distribution). When this rare event occurs, probability favors reversion. Traders typically buy at z-scores below -2.0 (oversold) or sell/short at z-scores above +2.0 (overbought).
But doesn't z-score of -2.0 happen frequently in volatile markets?
Volatility adjustment is critical: High-volatility ETFs like QQQ reach z-score extremes more often than low-volatility ETFs like XLU (utilities). That's why z-scores—which divide by standard deviation—automatically adjust for volatility. A z-score of -2.0 for QQQ represents the same statistical rarity as -2.0 for XLU, even though the absolute price moves differ dramatically. This normalization lets you use consistent entry rules across different ETFs.
Should I wait for the z-score to cross below -2.0 or enter immediately?
Trigger timing matters for reducing false signals: The most disciplined approach waits for the z-score to cross below -2.0 from above—confirming this is a new extreme rather than continuation of an existing one. This avoids entering too early during downtrends. Some traders add a confirmation filter: only enter if today's z-score is below -2.0 AND yesterday's was above -2.0. This catches the exact crossover point.
How do I screen for these signals across multiple ETFs?
Multi-ETF signal detection in real-time: You need a system that calculates z-scores for all ETFs you track and flags new signals immediately. In Excel, this means building complex IF statements checking multiple conditions: =IF(AND(F52<-2.0, F51>-2.0), "BUY", ""). Multiply this across 11 sector ETFs with different data ranges and formula maintenance becomes overwhelming.
Sourcetable makes signal detection conversational: "Show me all sector ETFs that crossed below z-score -2.0 today." The AI scans today's data versus yesterday's, identifies new threshold crossings, and presents results instantly. You see: XLE crossed to -2.1 (was -1.8 yesterday), XLB crossed to -2.3 (was -1.9 yesterday). These are your trade candidates. No formulas, no manual checking—just actionable signals.
Entry signals identify opportunities, but exit strategy determines profitability. Mean-reversion trades make money as prices return toward the statistical average—but when exactly do you close the position? Exit too early and you leave money on the table. Exit too late and you give back gains or turn winners into losers.
Most successful mean-reversion traders use one of three exit approaches:
You also need protective stops for trades that don't revert: price continues moving against you, z-score reaches -3.0 or lower, creating losses that exceed average wins. Common stop-loss rules include exiting if z-score reaches -2.8 (further extreme), dollar loss exceeds 4-5% of entry price, or holding period exceeds 15 days without reversion (time-based stop).
Testing which exit approach works best requires comprehensive backtesting. In Excel, you're tracking signal pairs manually: marking entry date/price when z-score crosses -2.0, scanning forward to find when exit condition occurs (z-score returns to -0.5), calculating return between entry and exit, and aggregating across all trades. This logic requires complex nested IF statements with look-ahead references that break easily when data updates.
Sourcetable handles exit strategy testing through plain English: "Backtest SPY buying at z-score below -2.0, compare three exits: (1) z-score returns to 0, (2) z-score reaches -0.5, (3) z-score crosses +1.5. Show me win rate and average return for each exit rule." The AI executes all three backtests simultaneously and presents comparative results. You see: Exit at 0 = 64% win rate, +2.8% avg gain. Exit at -0.5 = 71% win rate, +1.9% avg gain. Exit at +1.5 = 48% win rate, +4.7% avg gain. Now you can choose the risk-reward profile that fits your trading style.
Let's walk through an actual mean-reversion trade using the XLE (Energy Select Sector SPDR) selloff in September 2024. This demonstrates the complete process: signal identification, entry execution, exit management, and performance analysis.
Market Context - September 5, 2024: Oil prices dropped 8% in three days on recession fears. XLE, which tracks energy stocks, sold off sharply. While broader market (SPY) declined modestly (-1.8%), energy got crushed disproportionately—classic sector rotation creating mean-reversion opportunity.
Step 1: Signal Detection
You upload daily price data for 11 sector ETFs to Sourcetable and ask: "Calculate 50-day z-scores for all sector ETFs as of September 5, 2024." The AI responds:
XLE clearly stands out with z-score of -2.4, meeting your entry threshold of -2.0 or below. You verify this is a new signal: "Was XLE's z-score above -2.0 yesterday?" Sourcetable confirms: September 4 z-score was -1.7. This is a fresh threshold cross—valid entry signal.
Step 2: Historical Validation
Before entering, you want confidence this setup has worked historically. Ask: "Show me the last 10 times XLE's z-score dropped below -2.0, and what the returns were over the next 10 trading days." Sourcetable analyzes history and reports:
Strong historical edge with 80% win rate and positive asymmetry (average win of +4.5% versus average loss of -1.8%). You decide to enter.
Step 3: Position Sizing and Entry
You have a $100,000 trading account and risk 2% per trade ($2,000). Set stop-loss at 5% below entry (if XLE falls to $82.94, exit for $4,360 loss, slightly exceeding your $2,000 risk budget but acceptable for the setup). Position size: $2,000 / 0.05 = $40,000. At $87.30 per share, that's 458 shares.
You buy 458 shares of XLE at $87.30 on September 5, 2024. Total investment: $39,983.
Step 4: Daily Monitoring
Each day, you ask Sourcetable: "What's XLE's current z-score?" The AI updates you:
Step 5: Exit Decision
Your exit rule is z-score returns above -0.5. On September 12, z-score reaches -0.4, triggering your exit. You sell 458 shares at $91.80 for total proceeds of $42,044. Profit: $2,061 on $39,983 investment = +5.16% return in 5 trading days.
Step 6: Trade Analysis
After closing, you ask Sourcetable: "Add this XLE trade to my tracking and calculate my mean-reversion strategy performance this quarter." The AI logs the trade and reports: 7 trades completed, 6 winners (85.7% win rate), average gain +4.2%, total return +28.9% on capital allocated to mean-reversion trades (not total account size). You're outperforming the backtest historical average—validation that your execution is sound.
This complete workflow—signal detection, historical validation, position sizing, daily monitoring, exit execution, and performance tracking—would take 45+ minutes daily in Excel with complex formulas and manual calculations. Sourcetable compressed it to under 10 minutes per day through conversational AI that handles all statistical computations automatically.
Mean-reversion strategies work across all instruments, but ETFs offer specific advantages that improve win rates and reduce risk compared to trading individual stocks.
Sourcetable amplifies these ETF advantages by making it easy to screen across dozens of ETFs simultaneously, finding the cleanest mean-reversion setups. Ask: "Show me all ETFs with z-scores below -2.0 that are part of uptrending sectors (200-day slope positive)." This combines mean-reversion timing (oversold) with trend context (uptrend), giving you the highest-probability trades. You can't practically screen 500 individual stocks with this level of statistical rigor in Excel, but you can easily analyze 50-100 ETFs with Sourcetable.
Once you master basic mean-reversion entries and exits, sophisticated traders layer in pairs trading—exploiting temporary divergences between correlated ETFs. This creates market-neutral positions that profit from relative moves rather than absolute direction.
The pairs trading setup: You identify two ETFs that normally move together (high correlation), wait for temporary divergence (one outperforms the other by 2+ standard deviations), then bet on convergence by going long the underperformer and short the outperformer. When correlation reasserts, you profit on both legs regardless of market direction.
Common ETF pairs:
Analyzing pairs in Excel is complex: you need to calculate price ratios, ratio moving averages, ratio z-scores, and identify divergence signals—all while tracking correlation stability. In Sourcetable, ask: "Calculate the 30-day z-score of the SPY/IWM price ratio." The AI handles the ratio calculation and statistical analysis automatically. Then: "Show me historical instances when this ratio z-score exceeded +2.0 and how long it took to revert below +0.5." You get immediate backtest results showing pairs trade viability.
For active pairs traders managing multiple simultaneous positions, Sourcetable can monitor everything: "Track my three open pairs trades and alert me when any spread z-score crosses 0." You get automated alerts when it's time to close positions, ensuring you capture profits as spreads normalize.
If your question is not covered here, you can contact our team.
Contact Us