Many parameters within the backtesting algorithm are weights that and used for calculating the theoretical returns. The goal of this optimization problem is maximize both accuracy and return. Currently, a strategy called Sequential Least Squares Programming (SLSQP) is being used optimize a provided a set of parameter weights. This functionality is built into scipy and can called using scipy.minimize.