Selection Sort Python Algorithmic Trading