Back to Blog
Technology February 8, 2026 15 min read

How Quanta AI's Time Machine Algorithm Works — Technical Deep Dive

The Time Machine is Quanta AI's core prediction engine. It compares current stock patterns against 5 million+ historical scenarios to predict what happens next. Here's exactly how it works.

The Core Idea: History Doesn't Repeat, But It Rhymes

Mark Twain's famous observation applies perfectly to stock markets. While no two market situations are exactly identical, similar patterns tend to produce similar outcomes. The Time Machine algorithm operationalizes this insight at scale.

Given any stock's recent price action, the Time Machine searches through 5 million+ historical patterns across 3,000 stocks and 250+ crypto assets to find the closest matches. It then analyzes what happened after those similar historical patterns to generate forward-looking predictions with confidence scores.

Think of it as a financial historian with perfect memory that can instantly recall every relevant precedent for any stock pattern you show it.

Step 1: Feature Extraction

The first step is converting raw price data into a rich feature vector. For each stock window (typically the last 60 trading days), the Time Machine extracts:

Price Features — Normalized price trajectory, returns distribution, volatility regime (low/normal/high/extreme), trend direction and strength.

Technical Indicators — RSI (14-period), MACD signal and histogram, Bollinger Band position, ATR, OBV trend, and rate-of-change across multiple lookback periods.

Volume Profile — Volume trend, relative volume vs. 20-day average, volume-price correlation, and accumulation/distribution signals.

Pattern Features — Candlestick pattern identification, support/resistance levels, Fibonacci retracement alignment, and consolidation detection.

This multi-dimensional feature vector captures far more information than any single indicator or visual pattern.

Step 2: Similarity Engine (DTW + Feature Matching)

The similarity engine uses an ensemble approach combining two complementary methods:

Dynamic Time Warping (DTW) — DTW is a powerful algorithm that measures the similarity between two time series that may vary in speed or timing. Unlike simple correlation, DTW can match patterns that are stretched or compressed in time — a head-and-shoulders pattern that forms over 30 days matches one that forms over 45 days.

Feature-Based Similarity — This compares the extracted feature vectors using weighted cosine similarity. Features are normalized and weighted by predictive importance (determined through historical backtesting).

Ensemble Scoring — The final similarity score is a weighted combination of DTW similarity and feature similarity, calibrated to maximize prediction accuracy. This ensemble approach is more robust than either method alone because DTW captures shape similarity while feature matching captures regime similarity.

Step 3: Prediction Generation

Once the top-K most similar historical patterns are identified (typically K=10-20), the Time Machine generates predictions:

Forward Returns — It analyzes the 5, 10, and 20-day forward returns that followed each matched historical pattern. The prediction is the weighted average of these returns, with weights proportional to similarity scores.

Confidence Score — Confidence is based on: (a) how similar the matches are, (b) how consistent the forward returns are across matches, and (c) how many high-quality matches were found.

Risk Metrics — Maximum drawdown, volatility, and worst-case scenarios from the matched patterns provide built-in risk assessment.

Win Rate — The percentage of matched patterns where the forward return was positive, giving a straightforward probability estimate.

Proof Fund: Real-World Validation

Theory means nothing without results. That's why we run the Proof Fund — a live-tracked portfolio that trades exclusively based on Time Machine signals.

Current Performance: - Total Return: +33.6% - Sharpe Ratio: 2.11 - Total Trades: 127 - Updated: Daily

Every trade is recorded and published. No cherry-picking, no survivorship bias, no hypothetical returns. The Proof Fund page shows the equity curve, trade log, and detailed statistics.

This transparency is rare in the AI trading space, where many platforms show backtested results but hide live performance. We believe the best way to earn trust is radical transparency.

Multi-Timeframe Analysis

The Time Machine operates across three timeframes:

Daily — Best for swing trades (5-20 day holding periods). Uses daily OHLCV data with 60-day lookback windows.

Weekly — Captures intermediate trends (1-3 month horizons). Reduces noise and identifies stronger, more reliable patterns.

Monthly — Identifies major market regimes and long-term trend changes. Ideal for position traders and portfolio allocation decisions.

Analyzing all three timeframes simultaneously gives a complete picture. A bullish daily pattern inside a bearish weekly and monthly context is very different from a bullish daily pattern confirmed by bullish weekly and monthly setups.

Frequently Asked Questions

How many patterns does the Time Machine analyze?
The Time Machine database contains 5 million+ historical patterns across 3,000 stocks and 250+ crypto assets, covering multiple market regimes, sectors, and timeframes.
How often are predictions updated?
Predictions are generated in real-time when you analyze a stock. The underlying pattern database is updated with new market data daily.
What is DTW (Dynamic Time Warping)?
DTW is a mathematical algorithm that measures similarity between two time series that may vary in speed. It's especially useful for stock patterns because similar chart formations can develop at different paces.

Try Quanta AI Free

Experience the Time Machine, AI Copilot, and pattern recognition with a free account. No credit card required.

Create Free Account
Comparing platforms?
See Quanta AI vs TradingView, Trade Ideas, Trendspider and more in one place.
Open comparison hub