Hi! I've been trying to improve the IB brokerage model, as it doesn't take into account slippage and leverage interests I want to add them to the model. I add a constant slippage manually in initialize and there is no problem but when I try to make a custom model and import it to the main code it runs but it doesn't change the results of the backtest so thats the fisrt issue. For the leverage interest costs I tried to reserve some liquid cash by manually setting requiredFreeBuyingPowerPercent in BuyingPowerModel as suggested in this thread but it gives me this error: 

Backtest Handled Error: Order Error: id: 2869, Insufficient buying power to complete order (Value:142336.5897), Reason: Id: 2869, Initial Margin: 142339.744675525, Free Margin: 100000

Im working with leverage. Any help is appreciated, I attached the backtest & code. 

Thank you in advance!

Author