Introduction
Liquidity has a powerful impact on price and the valuation of Equities. Stocks with little liquidity are used to earning higher returns than stocks with high liquidity. In this algorithm, we present the effect of liquidity on returns for the lowest capitalization quartile from the largest 1,500 stocks.
Method
In coarse universe selection, we filter stocks whose price is higher than $5. ADRs, ETFs, and closed-end funds are all excluded with the HasFundamentalData
property of the CoarseFundamental
objects.
In fine universe selection, in the first step, we exclude stocks with the market cap less than ten million.
To evaluate the liquidity of stocks, we choose the annual turnover which is the number of shares traded divided by the stock’s outstanding shares.
The main advantage of turnover against volume is its market capitalization-neutrality, as either small-cap or large-cap stocks can have low or high turnover rates.
Although turnover is capitalization neutral, the liquidity effect is the strongest among small-cap stocks. Therefore, stocks are then divided into quartiles based on their market capitalization. Stocks from the lowest market-cap quartile are again divided into 5% and 95% quantiles based on their turnover. To calculate the turnover,
we request the historical daily volume for the last one year and compute the mean volume. The turnover is the average annual volume divided by SharesOutstanding
in CompanyProfile
.
Stocks in the 5% quantile and in the top 95% percentile are saved in self.long
and self.short
lists, respectively.
In OnData, the algorithm goes long on stocks in the lowest turnover list and short on stocks in the highest turnover list. Stocks not in those two lists are liquidated. The portfolio is rebalanced once a year and stocks are weighted equally.
Derek Melchin
See the attached backtest for an updated version of the algorithm in PEP8 style.
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.
Jing Wu
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!