We test the efficient markets hypothesis by using machine learning to forecast future stock returns from historical price plots. These forecasts strongly predict the cross section of future stock returns. The predictive power holds in most subperiods, is strong among the largest 500 stocks, and is distinct from momentum and reversal. The forecasting relation is highly non-linear and remarkably stable through time. Our research design ensures that our findings are not a result of data snooping. We conclude that the efficient markets hypothesis does not hold and that investment strategies based on technical analysis and charting may have merit.