The weak form of the Efficient Market Hypothesis (EMH) states that the current market price fully reflects the information of past prices and rules out predictions based on price data alone. In an efficient market, consistent prediction of the next outcome of a financial time series is problematic because there are no reoccurring patterns that can be used for a reliable prediction. This research offers an alternative test of the weak form of the EMH. It uses a universal prediction algorithm based on the Variable Order Markov tree model to identify re-occurring patterns in the data, constructs explanatory models, and predicts the next time-series outcome. Based on these predictions, it rejects the EMH for certain stock markets while accepting it for other markets. The weak form of the EMH is tested for four international stock exchanges: The German DAX index; the American Dow-Jones30 index; the Austrian ATX index and the Danish KFX index. The universal prediction algorithm is used with sliding windows of 50, 75, and 100 consecutive daily returns for periods of up to 12 trading years. Statistically significant predictions are detected for 17% to 81% of the ATX, KFX and DJ30 stock series for about 3% to 30% of the trading days. A summary prediction analysis indicates that for a confidence level of 99% the more volatile German (DAX) and American (DJ30) markets are indeed efficient. The algorithm detects periods of potential market inefficiency in the ATX and KFX markets that may be exploited for obtaining excess returns.