A Framework for Online Investment Algorithms