How a Basic Algorithmic Trading System Works