Here's an attempt at a liquidity alpha factor (via combination several liquidity alpha factors into one).
Here's an attempt at a liquidity alpha factor (via combination several liquidity alpha factors into one).
Interesting one, thanks @Grant! Think you might have found a reason for why Q may not want to license individual (weak) factors, but when combined, the factor of related factors becomes more robust and possibly more interesting?
@Grant,
a very interesting LIX indicator.
Thanks for sharing.
I created the LIX indicator to see how we can use it to determine market regime.
@ Viridian Hawk -
Wouldn't
shs_float_cfbe a better liquidity gauge thanshares_outstanding?
Not sure. Could you explain your reasoning?
@ Vladimir -
I just spent a little time Googling factor etfs/smart beta/alpha factors, etc. and came across the idea of liquidity. For example:
https://investor.vanguard.com/etf/profile/VFLQ
There, it says:
Fund invests in stocks with relatively lower measures of trading liquidity.
The Liquidity factor is measured by percentage turnover, dollar turnover, and Amihud illiquidity.
It is worth noting that on Q, one could use minute bar data to construct liquidity (illiquidity) factors. There may be liquidity information not revealed in the daily bars.
“Shares outstanding” includes shares "closely held" by insiders and shares otherwise restricted from being traded. "Float" refers to the shares that can actually be traded freely on the public markets, and as such is probably a better fit conceptually for gauging liquidity.
In my opinion...
The Good:
-Consistent specific IR (not too sporadic drops, or negative specific IR)
-Very little Style tilts
-Scoring most stocks in the QTU using TargetWeights
-Low turnover
-Might have value for certain Sectors?
The Bad:
-Relatively low Returns, both specific and common (specific is what matters, and it looks a bit better than common/total)
-Some ‘extreme’ Sector exposures.
-Seems fairly volatile
The Ugly:
-Sector tilts.
Grant ,
Recently, I spent some time working on the illiquidity ratio (ILLIQ), and found that it behaves very much like various volatility factors.
There were a lot of nans so I changed to
out[:] = np.nansum(ilq)
I used DailyReturns instead of Returns and multiplied the value by 1000 to see the numbers.
Amihud (2002) illiquidity ratio, ILLIQ, is one of the most widely used in the industry and is
the daily ratio of absolute stock return to its dollar volume averaged over some period.
Here it is for QTradableStocksUS.
Than I decided to test ILLIQ as volatility switch on Yulia Malitskaya conventional momentum winners (W_10).
I even left her magic threshold 0.27.
The results are not the best but very similar to backtests with other volatility factors.
Thanks Vladimir -
I see this as a potential test case to see if Q is really interested in funding a lot more itsty-bitsy alphas under the new signal combination paradigm, as they've said they would. It seems that they should publish a list of 50-100 of such little projects, versus trying to find the goose that laid the golden egg. I'd be glad to get in on the action at some low, but consistent monthly payout, versus shooting for the $50M grand prize.
@ Vladimir -
I used DailyReturns
Thanks for the tip! I think I had the Amihud (2002) illiquidity ratio incorrect.
Now I have:
class ILLIQ(CustomFactor):
inputs = [USEquityPricing.close, USEquityPricing.volume, DailyReturns(window_length=2)]
window_length = 253
window_safe = True
def compute(self, today, assets, out, close, volume, ret):
ilq = np.absolute(ret)/(close*volume)
out[:] = preprocess(np.nansum(ilq,axis=0))
with
from sklearn import preprocessing
def preprocess(a):
a = a.astype(np.float64)
a[np.isinf(a)] = np.nan
not_nan_ind = np.argwhere(~np.isnan(a))
if not_nan_ind.size > 0:
a_win = winsorize(a[not_nan_ind], limits=[WIN_LIMIT,WIN_LIMIT])
a[not_nan_ind] = a_win
else:
a = winsorize(a, limits=[WIN_LIMIT,WIN_LIMIT])
a = np.nan_to_num(a - np.nanmean(a))
return preprocessing.scale(a)
Grant ,
It is not necessary to specify a window length for DailyReturns
DailyReturns() is the same as DailyReturns(window_length=2)
I did not use preprocessing just to see how it looks like originally.
Thanks Vladimir -
One extension here would be to use the Q minute bar data. I have to think there's more than just thin air in liquidity, if Vanguard (and perhaps others) went to the trouble of launching an ETF. There's probably a bunch of academic and industry research on the topic, or they'd be sticking their necks out pretty far.
Grant -- according to Quantopian's TOS as soon as you've posted an algorithm to the forum they are free to use it license-free -- you basically give up any authorship rights to that code. So I hope for your sake you're keeping the really juicy stuff secret.
@ Viridian Hawk -
It's a hobby so there's really nothing to lose.
Anyway, if you have anything technical to add to this thread, on the topic of liquidity, please contribute.
Glancing at https://investor.vanguard.com/etf/profile/portfolio/vflq suggests that this "factor" ETF may have significant exposure to some "common" factors (e.g. size and value). I'm guessing that even though it is called a "factor" ETF, it is more like a "smart beta" ETF in that it has a constraint to attempt to kinda-sorta track the Russell 3000 benchmark versus actually isolating liquidity while controlling for other common factors.
@ Antony -
Thanks. I gather that you are an academic finance type. Is there any kind of consensus on liquidity as a factor in academic circles? I imagine that at some point, there was a sort of consensus on the original Fama and French factors being "real" (of course, academics make a living out of arguing over minutiae, so "consensus" is probably too strong of a word); perhaps there is similar acknowledgement that liquidity is not just vaporware.
@ Antony -
O.K., and I guess it works the other way too? Stocks that are easy to trade are a bit over-priced due to the fact that folks are willing to pay extra for the assurance that they can cash out whenever they want.
If you buy an asset knowing that it's going to be difficult to unwind when you most need to, you'll probably want to pay less for it. And that's where the risk premium is earned.
Would it be reasonable then to assume then that heavily shorted stocks would have an offsetting effect, since you'll probably want to short the stock at a higher basis for the same reasons and collect risk premium on the short side?
@ Viridian Hawk -
I think you are suggesting that liquidity may be different from a long versus a short perspective, since there may be a difference in closing out the position. In effect, there could be "long liquidity" and "short liquidity".
For example, the QTradableStocksUS() uses the 200-day median daily dollar volume as a proxy for liquidity (see https://www.quantopian.com/help#quantopian_pipeline_experimental_QTradableStocksUS). However, maybe this tilts the QTU toward long liquidity? But really one needs to be able to go long or short with the same ease, I think, for the kind of fund Q is constructing. It also costs more to short, so there's a barrier to shorting relative to going long.
Does Quantopian have so-called short interest data? Along with relative borrowing rates... Seems like a pretty basic set of data...