Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Quantopian Tradable Universe Updated from Experimental to General API

With today's release, you now have access to a stable, robust stock universe as the foundation for your algorithm. We recommend that you use the Quantopian Tradable Universe as the first step of every strategy you write. The convenient built-in has been migrated from the experimental namespace to the general Quantopian API. We released this universe a few months ago in experimental mode, heard your feedback, ran further analyses, and incorporated some changes.

In addition to adjusting several of the existing filters, a new filter was added: removing any securities marked as M&A targets. When a security becomes an acquisition target, its behavior can significantly deviate from its regular trading regime, and your strategy may falsely detect an opportunity without knowing about the external event. This premium dataset is available for your free usage within the built-in universe, helping to remove idiosyncratic risk.

Here are the filters that were improved:


Filter                                      Previous Requirement   Current Requirement      Rationale for Adjustment
Market cap minimum $500m $350M over a 20-day simple moving  average A single-value threshold creates additional jitter. We adjusted to be a moving average.
Trailing close price Must have close price every day for previous 200 days Must have close price for 180 out of last 200 days AND in each of last 20 days The security must have enough trailing history and still be actively trading.
Trailing volume Must have volume every day for previous 60 days N/A Redundant with trailing price window and liquidity filter.
$5 minimum price Stock’s previous close price must be above $5 N/A Price is not an adequate proxy for bid-ask spread. Liquidity is already measured via average daily volume filter.
Remove M&A targets N/A Equities with IsAnnouncedAcquisitionTarget() are screened out Securities that are marked as M&A targets experience severe movements outside of expected price and fundamental data inputs.

We appreciate your feedback in the forums and carefully reviewed all the suggestions. Some were not included in this iteration and may be included in a future version.

To use the universe in your strategy, you can import from quantopian.pipeline.filters import QTradableStocksUS. You can read the full criteria in the API documentation and can start working on your contest entry using this tutorial. Enjoy!

Disclaimer

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 Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian 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.

21 responses

Alisa, How can I use IsAnnouncedAcquisitionTarget() as a standalone filter in pipeline?

Thanks

Have you thoroughly tested these changes with different algos? I now have some algos running perfectly fine under the experimental mode that now hangs at a particular date? I suspect it has something to do with the removal of M&A targets. When do you remove the M&A target? At point in time when announcement was made? If that 's the case, then it is a problem because if like in my case I am filtering Liquidity with weekly down sampling. So choice of stock selection is made at start of the week, Monday. If you remove a stock in that selection due to M&A target announcement made the next day, Tuesday, then Optimize API doesn't know how to handle this missing stock from the selection then therefore it hangs.

Also, you made this change in the middle of people submitting entries to Contest 38, how will you handle this? Will you have to ask all to rerun and resubmit their two year backtest with this new QTU or will you do it yourselves? This all too confusing now and guidance from your staff should be provided.

Also as a follow up and I quote:

In addition to adjusting several of the existing filters, a new filter was added: removing any securities marked as M&A targets. When a security becomes an acquisition target, its behavior can significantly deviate from its regular trading regime, and your strategy may falsely detect an opportunity without knowing about the external event. This premium dataset is available for your free usage within the built-in universe, helping to remove idiosyncratic risk.

I question the reasoning and logic of this change as stated above specially this part..."helping to remove idiosyncratic risk." You guys are imagining these "idiosyncratic risk", your words not mine because these are real life trading occurences. Some hedge funds I know of exploit these by having insiders' information which is illegal while others diligently anticipates these potential M&A targets through thorough industry and fundamental analysis . So if I write an algo that does a lot of fundamental analysis and is able to identify that the stock is heavily undervalued and can be a potential M&A target and it turned out to be spot on then by removing this stock as a result of a M&A announcement, you've deprived me of an opportunity to make a killing because of my brilliant due diligence. I don't think that's fair. You see it as a risk while I see it as an opportunity, a real term opportunity not an imagined risk. Quite frankly, I think you guys have overloaded the model with all kinds of risk mitigation / elimination routines for a strategy that is only expected to have returns just above the risk free rates. You're squeezing it too much that it curtails the potential to have a fair chance to give out a decent return. Basic investment principles still hold high returns/high risks, low returns/low risks and if you want middle of the road returns / middle of the road risks. Stick to what has been already empirically proven and don't keep reinventing the wheel. End of rant :)

@Kamran - You can use the ~ IsAnnouncedAcquisitionTargetin Eventvestor's dataset for free as a standalone filter for testing. If you want the standalone filter through the present, you need to purchase it as with any regular dataset. But if you use the QTU, you're getting the use of that data through present, for free.

@James - Yes we have tested with a variety of strategies, and if you're seeing a slowdown could you email our support team at [email protected]? They can take a look and suggest ways to optimize the code. Or perhaps you found a bug, which we'd love to see, and fix. In general, the universe gets recomputed every time your algorithm runs -- if your algo runs weekly on Mondays and a stock exited the universe on Tuesday, the algorithm won't know about this until the computation the following Monday. If a stock is not present in the universe at the next computation and your algorithm holds an existing position in the stock, it will try to close it out via the optimizer. The security would not be in your new target portfolio.

Regarding the contest, the feature was in experimental mode. With anything that's experimental, it is subject to change. Now that it's been migrated to the general API, it will be less fluid and any future improvements will be coordinated with contest entries.

I fully agree with you that there are plenty of viable strategies revolving M&A targets. From our experience working with authors to create strategies, and trading strategies within a portfolio environment, many people do not consider these real-world events and are negatively impacted by the movements. If you have an M&A strategy, we're happy to consider and evaluate it. Send us an email, [email protected].

Cheers,
Alisa

@Alisa,

I am not experiencing a slowdown but a total hang, i.e, it is just stuck at a particular date July 12, 2016 for hours. I have already wasted a whole day trying to figure it out, changing configuration of every imagineable possibilities. I was able to make it work by limiting the stock selection to bare minimum i.e. 20 stocks. So I am almost sure it has something to do with removing stocks on M&A target announcement list. As I don't have the benefit of seeing Eventvestor's dataset, I did a quick Google search of that date with key words like M&A announcements, there are several of them that popped out. As to which one of them is in my stock selection, your guess is as good as mine. I wouldn't want to email your support team because I already know the first thing that they'll ask, the standard if you could please send in your code and give permission to view it. This code is a contest entry, I wouldn't want my secret sauces spilling all over your kitchen. So I politely ask that you take the effort to discover this potential bug on your own, you have the resources and it is not that hard to simulate. My algo runs daily, contrary to your assumption above, but filters stock liquidity on a weekly basis for stock selection. This is not hard to recreate and simulate, if you guys take it upon yourselves to do some work.

From our experience working with authors to create strategies, and trading strategies within a portfolio environment, many people do not consider these real-world events and are negatively impacted by the movements.

Q heavily promotes using alternative data as a means of finding alpha. So I will cite another example along this flavor. I create a routine within my algo that uses Natural Language Processing to scour the internet through Google Trends for key words like M&A, company target, company acquirer, mergers, undervalued, etc.as one of my alpha factors to be combined with many others. If it does its job right, it will pick up potential M&A targets in its stock selection process although it is not the only factor considered, there are others. Why are you then discounting such intelligent routines while at the same time promoting alternative data? You want sophistication and diversification of alpha factors but yet your statement above seems to be weeding out these things by concluding that "...many people do not consider these real-world events and are negatively impacted by the movements." What about those impacted positively by these events?

When a security becomes an acquisition target, its behavior can significantly deviate from its regular trading regime, and your strategy may falsely detect an opportunity without knowing about the external event.

Why are you making conclusions about the intentions of the authors? Can you see the author's code? And what if the author intentionally tries to identify this opportunity, why are you penalizing his desired opportunity to achieve his alpha? What is the whole point of your strategy framework? I think you guys are making wrong assumptions here and arriving at wrong conclusions.

Hello Alisa,

Once a stock is tagged to potentially undergo an merger/acquisition, it is dropped from the QTradableStocksUS. What happens if the merger/acquisition doesn't go through? Would it then be de-tagged, and end up back in (which could also result in some whacky behavior, due to the failed marriage)? Or would it be permanently excluded from the universe?

Also, how is the "target" determined? If I understand, only one company is excluded from the universe. But it seems that some cases are more combinations of complementary companies.

I looked at https://www.quantopian.com/data/eventvestor/mergers_and_acquisitions and there isn't much info. Just wondering how this works...

Hi Alisa -

Is there a way to see the QTradableStockUS source code? In the research platform, I tried:

from quantopian.pipeline.filters import QTradableStocksUS  
import inspect  

and got:

InputRejected:
Importing inspect raised an ImportError. Did you mean to import bisect instead?

Or perhaps it is available on Github?

Also, I would consider how you intend to manage moving from experimental to released. I note that the risk model is in experimental so what is the process vis-a-vis your users to move it to released? Will there be a request for comment on proposed changes, and a published target release date? Or will it just be changed and pushed out? I'm guessing you'd like to have the risk model released prior to the launch of the new contest, right?

Another question re: M&A - what constitutes making a company officially a "target" to be taken over? It would seem to make it official, some filing with the SEC or other regulatory body would be required? By the time it is "official" I'd think that it would be too late to have much effect in removing the target company from the universe--the cat would already be out of the bag.

Even if $350M minimum market cap over a 20-day simple moving average is better than a fix 500M, it's not yet ideal.
As I pointed here:
https://www.quantopian.com/posts/working-on-our-best-universe-yet-qtradablestocksus#5a281c40f222d100190e7a06
the threshold should be dynamic like O'Shaughnessy, Gray, Carlise and many other do.

Let me jump into the questions here,

@James: I'm sorry that you're having a hanging issue in your strategy, and unfortunately, I can't reproduce it. We haven't heard of anyone else reporting similar issues, and without seeing a concrete example, it's difficult to debug. If you find an example that you're comfortable sharing, we're happy to check it out and see how we can help.

You're right that there are many different types of strategies out there. The specific subset we're catering towards are long-short equity strategies that meet the new upcoming contest criteria. Afterward, we may launch separate contests, tailored towards other subsets of strategies, and could create new universes to help with that discovery.

Regarding your last statement, no, as stated in the Quantopian Terms of Use we do not look at your source code, this is encrypted. We do however talk to many people on the platform. And from thousands of these conversations, and those algos we've screened and invited to the portfolio, we've learned a lot about the process people take when constructing their strategies.

@Grant: If the merger doesn't goes through and the deal fails, the M&A tag will be removed and the stock can re-enter the universe (if it meets the remainder of the criteria). The "target" is determined if IsAnnouncedAcqTargetis True from EventVestor. Effectively this is a pipeline filter with ~IsAnnouncedAcqTarget.

@Ishwar: Great to see you're using the QTU in your strategy. Thanks for flagging the fundamentals filing dates, let me dig into this and get back to you.

@Grant pt 2: The filters are those laid out in the API documentation. The specific built-in isn't in Zipline but you should be able to get what you need from that set of filters.

@Grant pt 3: The value in knowing that a company is a target because the stock's price driver has changed. While a target, stock's price driven by forces different than the forces you identified when developing your model, and your strategy doesn't know about the new forces. For example, imagine you are developing a mean reversion algo. That algo makes a prediction on an acquisition target because the price popped and it believes the stock is a fantastic purchase. However the regular reversion forces are not at work. It would be blind to the extra information, that this is the new normal regime.

@Costantino: I agree! A historical market cap threshold that is relative over time is one of the pieces that didn't make this cut. We moved in the step in the right direction with a filter with less jitter, and will consider it again in a future release. Thanks for digging into it.

Thanks Alisa -

Is it safe to assume that the QTU goes from 01 Feb 2007 to the present, given that no M&A data is available for earlier dates? If so, you might want to add the detail to the help page.

The specific built-in isn't in Zipline but you should be able to get what you need from that set of filters.

Hi Alisa -

Is there a reason why the source code is not available? The QTU is a core part of your framework; not allowing user access to the code (unless there is a compelling reason), would seem to run counter to your overall mission of open finance (although I appreciate that there are proprietary elements you should keep private, the QTU would not seem to fall in that category).

@Alisa,

I quote you on your aboved reply post:

If a stock is not present in the universe at the next computation and your algorithm holds an existing position in the stock, it will try to close it out via the optimizer. The security would not be in your new target portfolio.

I ran an 11 year backtest here which passed all contest requirements except this:
Checking investment in tradable universe...
FAIL: Investment in QTradableStocksUS (2nd percentile) of 94.70% is < 95.0%.

I want to ask, based on your above statement, if I had an open position on IBM and the next day it was dropped from the QTU list, the algo will then try and close that position, how will the algo account for this transaction, as IBM now as in or out of the QTU list? I assume that a new QTU is updated before start of trading day and therefore has precedence over subsequent transaction during the day. Question is how a dropped stock from QTU list accounted for as it closes its postion during the day? This could be part of the problem if not accounted for properly, I think. Can you please check this.

How to use QTradableStocksUS in Alphalens?

@Tim Vidmar -

when you run the pipeline use QTradableStocksUS as universe, so that the factor values will be computed only for the assets belonging to QTradableStocksUS

universe = QTradableStocksUS()

pipe = Pipeline(  
    columns={  
        'myFactor' :  MyFactor(mask=universe)  
    },  
    screen=universe  
)

results = run_pipeline(pipe, ...)  

Thanks again, Luca, it's working!

Thanks!!!

Equities with IsAnnouncedAcquisitionTarget() are screened out

I tried adding a ~IsAnnouncedAcqTarget() screen to a number of my strategies and saw consistent, slight improvement. If this filter is already built in to QTU, why does adding it as an additional filter affect the results?

How many securities are in QTradableStocksUS ATM??

There are currently 2063 securities in the QTradableStocksUS universe. It varies and has been as low as 1287 and as high as 2266. See the attached notebook.

Disclaimer

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 Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian 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.

Thanks Dan!