Pairs trading system in python with MongoDB database