Maximize Profits Reallocating Investments in a Changing Market