Hi! I'm new to QC and I'm having trouble trying to use IB brokerage model and some other custom models as IB model doesn't include slippage and other things. I read in the docs that Brokerage models override any other models you may set for a security but I want to know if there is some way to implement a custom model while keeping IB model.
If anyone has done it, i would appreciate the help
Thanks!
Fred Painchaud
Hi Renata,
I won't be of great help here but you can either define an entirely new brokerage model by developing a class that derives from DefaultBrokerageModel, and thus re-implementing IB brokerage model, or you can develop a class that derives from InteractiveBrokersBrokerageModel, to specialize the behaviour (I would start by looking at that option first). The second option is the closest to “some way to implement a custom model while keeping IB model”.
That being said, I did not do it. You would need to look more closely at how the architecture works for slippage (like which method you need to implement or something like that).
I'm assuming here you understand basic object-oriented (OO) programming concepts.
Cheers,
Fred
Fred Painchaud
Hi again Renata,
Me again. I don't know QC's entire architecture/framework well yet (but I'm working on it 😊). But it seems like slippage is attached to orders:
https://lean-api-docs.netlify.app/interfaceQuantConnect_1_1Orders_1_1Slippage_1_1ISlippageModel.html
So maybe you can use IB brokerage model as-is but add some slippage model to your orders…
Cheers,
Fred
Fred Painchaud
😊
This is a joke. Sorry for the multiple posts. But you know, I am trying to help, that's it. So, there you go, you have an example of custom slippage model here:
https://www.quantconnect.com/docs/algorithm-reference/reality-modelling#Reality-Modelling-Slippage-Models
I hope all that helped you out…
Fred
Renata
Thanks for all the comments and all the help, Fred!!!
Renata
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!