integrated backtest prep sql to controller.py