Can an artificial intelligence learn to beat the stock market?