Hey QC forum
Quick question.
In pairs trading, one ticker could be associated with 2 other tickers, to create to pairs. An quick example would be MSFT-AAPL and MSFT-GOOGL. Here, MSFT is quoted twice. Furthermore, we want the strategi to be market neutral, as we would take a long position in the first stock, and short the other. MSFT is long twice, and AAPL and GOOGL is short.
Now to my question. A quick glance at the “EqualWeightingPortfolioConstructionModel” model, suggested that for each ticker, we would set a equal weight, as the title suggest. This also means, that we would have ⅓ in each ticker, as we only would have 3 tickers. Is their a way around this? Is the “InsightWeightingPortfolioConstructionModel” more suited for this? An furthermore, could we just set a weighting of 1 in each of the insights?
Hope somebody can sheed some light at the topic
Thank you
Lucas
Fred Painchaud
Hi Lucas,
I don't see why all that wouldn't be possible. I'm not done doing an exhaustive look at all models already in LEAN but it looks to me specific enough that such model might not already be there and thus you would need to develop your own PCM.
Is such an idea possible for you?
Fred
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.
Lucas
Hi Fred
As always, thanks for a quick response.
To be more precise, the long and short exposure seems to be a bit off, in the pairs trading algo. Sometimes by quite a lot. I think that i has to do with the PCM.
I have not developed my own PCM, but will look into it. Will post an example if i can get it to work proberly.
Lucas
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.
Lucas
Follow up comment
From debugging, the first insights sent to the portfolio construction model, had a lenght of 8. I then went to the EqualPCM model, and here, only 7 insights were given to the “activeInsights” parameter, in the "DetermineTargetPercent" function. Just to confirm, I could see that the alphamodel had sent a insight twice, with the same ticker (as intended), but it only had one of these insights in the activeInsights parameter. One of these insights had been thrown in the carbage.
With the limited knowledge of the PCM models, it seems hard to find a solution for this. Will mess around with some of the other PCM's to see if anything could help.
Lucas
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!