Back to Community
Attempt at creating a 'replica' of the QTradableStocksUS (QTSUS) universe

Hi All,

Attached is my crude (and messy) attempt at trying to recreate the QTSUS based on it's description in the Q Help Docs. Helps me a bit to slowly get my head around Python, Numpy, Pandas, DataFrames, CustomFactor, Functions, Methods, etc.

Since the upcoming new global markets won't have any built-in Q-universe filter available on day-1, my hope is that this might help in creating a decent 'TradableUniverse' once the FactSet dataset is available for each new market. Though maybe there will be better and simpler ways, depending on what data fields are available? For example, just selecting all common stocks (if they call them that in the new market) and sort/filter by top market cap and [xxx]-day average daily volume?

A lot of this is taken/amended from other people's dynamic universe filters. Note also that I don't always know how to 'mask' the second and third pass with the previous passes. I also don't know (tried and failed) how to select the 'most traded' (in the 2nd pass) based on 200 day Average Daily Volume, for stocks with multiple symbols, so I just picked the 'primary' one. I believe the universe is not 100% accurate mostly because of these two reasons.

If anyone would like to help to make the universe more accurately reflect the real QTSUS, I'd be very grateful! I'd also appreciate any other feedback, especially if I've made any clear mistakes.


Loading notebook preview...
2 responses


Thank you for such a great contribution, I made following changes based on your code:
- implement the "most liquid" factor
- redo the "valid close", "market cap" and "dollar volume" factor
- remove unnecessary filters & masks

Accurate rate is up to 99.6% but It's still be able to improved.

Loading notebook preview...

Hi John,

Thank you! Great improvement! 3 sigma accuracy is good enough in my book. :)

Will have a closer look tomorrow. I’m sure I’ll learn a lot from your improvements.