Framework for algorithmic trading