Implemented basic backtestring algorithm.