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.
Is it possible to use multiple execution models? Such as Standard Deviation Execution Model for anticipated weakly trending markets, and immediate execution model for anticipated strongly trending markets? Which alphas send the signals would be indicitive of market state.
Hi Ian,
Thank you for pointing out this creative question! It can be done using Custom Execution Model that combines StandardDeviationExecutionModel and ImmediateExecutionModel internally. Please let me show you one example as a reference.
In this example, it assumes that we should use some indicators to decide which Execution Model to be used. Here I will show how to link the Alpha Model and the Execution Model. I used a boolean *self.strongTrendingMarket* in the Alpha Model and passed the Alpha model to the Custom Execution Model, so the boolean was passed to the Execution Model too. In this way, you can set specific rules in Alpha Model part, and then pass the rules to Execution Model part in order to use different Execution Models at different time. Please check the Logs in the backtest to better understand this example.
To fully understand this example, I recommend you first know the code structure of ImmediateExecutionModel and StandardDeviationExecutionModel. Then, read the overview of Alpha Framework to have a better understanding of the link between Alpha Model and Execution Model. Finally, it will be easy for you to see how I combine these two Execution Models into this Custom Execution Model.
It might be a little bit challenging at first, but I believe you will figure it out. If you have any follow up questions, please feel free to contact me here. Good luck!
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!