Hi all,
I'm attempting to try and understand more about the framework and how it behaves when using a long short portfolio. I found a great start point created by @Emilio Freire Bauzano.
However, when I attempted to use a different universe (SMID), the algorithm seems to not want to open short positions. The algorithm works as intended when using Emilio's universe. I attempted to merge that universe with the new one (LiquidGrowthUniverse), and it works for opening Long Positions.
Any help would be sincerely appreciated.
Thank you,
Miguel
Louis Szeto
Hi Miguel
The reason for not shorting properly is because the correct value of maxNumberOfPositions is not passed to "SMIDGrowth". As a result, the universe will only return 20 equities, which is the default value of maxNumberOfPositions in the universe selection model, but not 40 as calculated by positionsOnEachSide*2. So the alpha model is trying to emit both long and short insight for the same equity (20 up 20 down in total).
To solve the problem, passing the desired number of maxNumberOfPositions argument to overwrite the default value for "SMIDGrowth" when you call the universe selection model in main.py will do.
Best,
Louis Szeto
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.
Miguel Palanca
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!