Daily AI Trading Paper

Daily AI Trading Paper

2026-11-20

Archived
2026-11-20

When Price Charts Rhyme: Historical Visual Retrieval for Stock Return Prediction

Hui Chen, Haoyu Liu, Ke Wu, Dexin Zhou

arXiv:2611.23723v1

This paper asks a simple but surprisingly hard question in trading: if two price charts look alike, do the stocks behind them tend to behave alike afterward? That is the old technical-analysis intuition, the idea that charts can rhyme. But most prior work tests that idea one pattern at a time, by hand, with rules like moving-average crossovers, breakouts, past winners and losers, or classic formations such as head-and-shoulders. Those studies are useful, but they only cover a narrow slice of what a chart can express. The authors take a different route. Instead of asking whether one named pattern predicts returns, they ask whether a machine can find visually similar historical charts and then use the realized future returns of those similar charts as a forecast. That matters because it turns chart reading into an explicit retrieval problem. You can inspect which past charts were deemed similar, see what happened after them, and connect the forecast back to concrete historical episodes rather than to a black-box output. The broader background here is the intersection of technical analysis and machine learning. On one side, there is a long literature showing that price, volume, momentum, and certain chart formations contain information about future returns. On the other side, recent work has shown that neural networks can extract predictive signals from chart images or return paths. But many of those models map the current chart directly into a return prediction. That can work well, but it is hard to interpret, because the model never explicitly says, “this looks like those other charts.” This paper is built to make that comparison explicit. The core framework is called historical visual retrieval. For each stock on each date, the authors render the prior 20 trading days as a standardized chart with open-high-low-close bars, a moving-average line, and volume. A vision encoder turns that chart into a numerical representation. Then the model searches a large library of historical charts drawn from all stocks, industries, and time periods, finds the nearest neighbors in representation space, and averages the realized subsequent five-day returns of those neighbors. To avoid look-ahead bias, a historical chart only enters the library after its future return has already been observed. So the forecast comes from two pieces: the encoder decides what counts as visually similar, and the historical outcomes of those similar charts supply the return signal. In other words, the model is not just learning from charts; it is using charts to retrieve comparable past episodes. The first important result is that even a vision model pretrained only on natural images already finds economically meaningful similarity in stock charts. The authors use DINOv2-S, a self-supervised vision transformer with no finance-specific training. Over the 2001 to 2025 out-of-sample period, a simple equal-weighted long-short portfolio formed on the average outcomes of the 1,000 nearest historical charts earns 26% per year with an annualized Sharpe ratio of 2.81. The alpha relative to the Fama-French five factors, momentum, and short-term reversal is 25%, so standard factors explain almost none of the spread. That is a strong statement: generic visual features learned from natural images already organize price charts in a way that matters for returns. The second result is even stronger. The authors fine-tune the representation on 1993 to 1999 charts so that charts followed by similar cross-sectional ranks of subsequent five-day returns become closer in representation space. They select the model using 2000 data and then freeze it before the 2001 out-of-sample period. They call this return-aligned representation FT-DINO. With the same retrieval rule and the same 1,000 neighbors, the equal-weighted long-short portfolio now earns 85% per year with a Sharpe ratio of 6.37 and an annualized alpha of 81%. That is more than double the Sharpe ratio of the pretrained benchmark. Importantly, the improvement is not coming from a different chart construction or a different historical library. The charts are the same, the retrieval rule is the same, and the forecast horizon is the same. The gain comes from aligning the representation with future returns, so the model focuses on the dimensions of visual similarity that actually matter for predicting the cross-section. The authors benchmark FT-DINO against a convolutional neural network from prior work that uses the same 20-day chart image but predicts returns directly. FT-DINO outperforms it: under equal weighting, the CNN portfolio earns 61% per year with a Sharpe ratio of 4.46, versus 85% and 6.37 for FT-DINO. Under capped value weighting, the Sharpe ratios are 1.82 for the CNN and 2.38 for FT-DINO. So the retrieval-based approach is not just interpretable; it is also stronger in this setup. They also show the two signals are not redundant. Even after controlling for pretrained DINO, the CNN, and standard factors, FT-DINO still has large alpha. That means the return-aligned retrieval signal contains information not captured by the direct image-to-return model or by common risk factors. A useful nuance is that a linear predictor built directly from the FT-DINO embedding performs nearly as well as retrieval. That suggests much of the predictive power comes from the representation itself. Retrieval still adds incremental alpha, but the main lift comes from learning a better visual space. The paper also looks at where the signal works best. Predictability is much stronger among stocks with greater limits to arbitrage. Using a composite score based on size, illiquidity, dollar volume, days to cover, lending fees, analyst disagreement, and turnover, the annualized spread rises monotonically from 14% in the lowest quintile to 119% in the highest. That pattern is consistent with mispricing persisting where trading is costly, shorting is hard, or non-fundamental demand has a bigger effect. The return dynamics around portfolio formation are especially interesting. The stocks with the highest retrieval signals are recent losers. The high-minus-low portfolio loses 5.39% in the formation week, while order flow turns to net selling. Then it earns 2.59% over the next 20 trading days as order flow turns back to net buying, and returns over days 61 to 120 are close to zero. About 58% of the initial decline reverses and is not given back over six months. That looks like temporary selling pressure that partially reverts, rather than a permanent shift in fundamentals. There is also a smaller component tied to salient winners. When the signal is built only from the most salient retrieved neighbors, the selected stocks are recent winners bought into the formation date, and the spread earns about 0.6% in the first month before turning negative over the next five months. That is consistent with salience-driven demand that later reverses, though on its own this component is much weaker. The authors run several robustness and ablation tests. Restricting retrieval to the last eight years, or to the query stock’s industry, still leaves the Sharpe ratio above 5.7. Excluding the query stock’s industry barely hurts. But restricting the library to the stock’s own history cuts the Sharpe ratio sharply, showing that cross-stock comparisons are doing most of the work. Within the chart itself, removing volume reduces performance meaningfully, while removing the moving-average line has little effect and changing the color convention barely matters. So the signal relies mainly on the geometry of the price path, with volume adding useful information. They also check investability. The strategy remains economically meaningful under standard screens and transaction costs, especially for equal-weighted portfolios. Among stocks priced at least $5, the equal-weighted FT-DINO portfolio still earns 36% per year with a Sharpe ratio of 3.94. Excluding the smallest 20% of stocks leaves the return essentially unchanged with a Sharpe ratio of 3.44. After reasonable one-way trading costs, the weekly strategy still earns 55% per year with a Sharpe ratio of 4.12. A four-week holding period reduces turnover a lot while preserving positive net performance. Finally, the paper tries to open the black box. Because FT-DINO uses a dense embedding, the authors fit a sparse autoencoder to decompose it into more interpretable visual features. They identify recurring states such as isolated upward spikes, sustained uptrends, late upside breakouts, and high-volatility ranges. These states matter, but no single one explains most of the signal. Instead, they affect performance largely by steering which historical charts get retrieved. The authors also reverse the process and start from recognizable textbook patterns, finding sparse directions that capture them, though these textbook patterns matter less for returns than the bottom-up features discovered through the data. So the main takeaway is that visually similar charts do contain return information, and a return-aligned vision representation can extract that information very effectively. The method is more transparent than a direct image-to-return model because each forecast points to actual historical charts and their realized outcomes. At the same time, the paper’s evidence suggests this is not just aesthetic pattern matching. The signal is strongest in hard-to-arbitrage stocks, it lines up with temporary selling pressure and partial reversal, and it survives a range of robustness checks. The main limitation is also clear: the method depends on historical analogs, so it can only work when the market keeps producing comparable visual states. And while the retrieval framework improves interpretability, the representation is still learned and the sparse features are only partially understandable. The next question is whether these ideas generalize across markets, regimes, and asset classes, and whether the retrieved visual states can be tied even more directly to microstructure, flow, or behavioral mechanisms.

Previous AI trading papers

2026-11-27Delta-Vega Hedging with Deep Reinforcement Learning: From Simulation to Reality2026-11-24Gated Payoff-Weighted Net Profit Maximization For Online Portfolio Selection With Transaction Costs2026-11-23Auto-Alpha: A Framework for Autonomous Factor Research2026-11-19AllocFlow: End-to-End Portfolio Trading Action Generation from Raw Market Data2026-11-16Who Should Be on the Panel? Task-Conditioned Persona Selection for LLM Trading Agents2026-11-15Fine-Tuning an Order-Flow Foundation Model for Sub-Second Forecasting2026-11-11Risk-Sensitive Reinforcement Learning for an Options Market Maker: An Empirical Study with Real S&P 500 Options2026-11-10Neural Realized Measures: Forecast-Supervised Intraday Aggregation for Volatility Forecasting2026-11-09CosmosAlpha: Multi-Relational Graph Search with Pareto-Guided Exploration for LLM-Driven Alpha Mining2026-11-04Thinking Fast, Trading Late: System One Decision Models vs the Market2026-11-03TensorLOB: Structure-Preserving Tensor Learning for Limit Order Book Forecasting2026-11-02Neural Network Methods in the 2BSDE Formalism for Solving the High-Dimensional Black--Scholes Equation with Transaction Costs2026-11-01FinLLM-KG: Knowledge Graph-Enhanced LLMs for Financial Sentiment Analysis in Algorithmic Trading2026-10-27Financial Context-Rich Strategy for Actor-Critic based Agents: A Deep Reinforcement Learning Approach for Stock Trading2026-10-26Understanding the Inner Workings of a State-Space Foundation Model for Limit Order Books2026-10-21Amortized Neural Filtering for Calibrated Posteriors in Statistical Arbitrage2026-10-20Probabilistic Limit Order Book Forecasting with Conditional Diffusion Models2026-10-19OrderFlowDiT: Transport-Regularized Diffusion Transformer for Probabilistic Limit-Order Supply Forecasting2026-10-18Data-Driven Dynamic Portfolio Selection with Vine Copula Simulation and Reinforcement Learning