I was looking at the implementation of:
PearsonCorrelationPairsTradingAlphaModel - this is the default pairs trading alpha.
I see that the function get_price_dataframe returns the diff in prices.
1.doesn't it make sense to return pct_change instead?
2. pair trade only based on the correlation? why don't you take into consideration also the cointegration?
Dave Mueller
Hey Gil:
The QC team may give you a better answer but I'll give it a shot.
1. the function get_price_dataframe is a method for normalizing the historical data passed through the function. To do this, it uses log price as a way of creating smoother prices (ie; comparing the relationship of securities that have roughly $5 per share and the other with roughly $2500 a share is made easier when using log prices). After logging the price values, it converts all historical data to the same time zone and then drops NaN values.
2. I believe this is true for all the framework examples, not just the pearson alpha. They are only examples of what can be done, and aren't meant to be used exactly as is (although functionally you could). For example, you could test the securities for cointegration, or anything else for that matter. The pearson test is just an example of one of many tests that can be done to check for pairs
Gil Sapir
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!