Starting today, Quantopian community members can programmatically access Morningstar’s corporate fundamental data.
Quantopian’s comprehensive historical fundamental data API is unprecedented in the industry. For the first time ever, individual investors can build fundamentally driven investment algorithms.
With access to the fundamentals data within your algorithm, you can use it to define your investible stock universe. Want your algorithm to only focus on stocks with a market cap over $1B? You can do it now. Filter stocks by PE ratio? By dividends? By EPS? All possible with Quantopian. The Quantopian IDE makes it easy to search for the right fundamental metrics for your algorithm.
We’ve taken care of the heavy lifting for you: Morningstar’s company identifiers are mapped to Quantopian’s security identifiers and the API includes ‘knowledge date’ indexing to avoid look-ahead bias. I can’t imagine an easier way to programmatically work with fundamentals.
Check out our simple example and documentation of the new methods for accessing and incorporating fundamentals into your code.
In tandem with this news, I’m delighted to announce two special offers:
1. As of January 1st, every registered user of Quantopian, will be guaranteed 6 months of complimentary access to the fundamental data in the Quantopian backtester. So if you’ve been lying in wait, now is the time to register for free. And if you have friends who are fundamental investors, please pass along the news!
2. Share your coolest fundamentals-based algorithm to the community forum before January 1st for a chance to win an additional 12 months of free access. Justin Lent, Quantopian’s new director of fund development, will review submissions and select the best sample algos to be highlighted on our blog in January. Submit your entry by January 1st and tag it with #Fundamentals in the post title to be considered.
We can’t wait to see the burst of creativity in the community that this is surely going to unleash.
Get started on Quantopian today.
By: Thomas Wiecki
Assessing performance as well as risk are key issues in quantitative finance. While there exist a large number of metrics like the Sharpe ratio to quantify this trade-off between reward and risk in a portfolio or an asset, there is an orthogonal source of risk – uncertainty in the estimation of these metrics themselves. As every measure is only an estimate based on limited and noisy data, quantifying the level of certainty we have into metrics like the Sharpe ratio becomes important.
Quantopian allows users to research, develop and launch trading algorithms that invest in the stock market. Recently, we also announced that we are developing a hedge fund – sourced from the top-performing quants in their community. In order to identify stellar quants and connect them with investors, estimating performance with few data points has become critical. Bayesian modeling is a flexible statistical framework well suited for this problem as uncertainty can be directly quantified in terms of the posterior distribution.
In my latest meetup series, I gave an overview of Bayesian statistics and how Probabilistic Programming frameworks like PyMC can be used to build and estimate complex statistical models. I then showed how several common financial risk metrics like the Sharpe ratio can be expressed as a probabilistic program to yield a Bayesian Sharpe ratio that includes a distribution of possible Sharpe values, each associated with a probability. I applied this type of Bayesian data analysis to evaluate the performance of anonymized real-money trading algorithms running on Quantopian.
You can also view the content via this slide share.
by Seong Lee
Earnings estimates (earnings per share or EPS) and revenue estimates are heavily used in both quant and fundamental stock analysis as forward-looking indicators of stock performance and sources of alpha. Traditionally estimates are given by sell-side analysts on Wall Street and are then aggregated and averaged into what is commonly referred to as “the Wall Street Consensus”. In 2011, the financial landscape changed when fintech startup Estimize launched their new platform allowing anyone on the web to share their own predictions on earnings and revenue estimates. Those estimates are then compared to what sell-side wall street analysts think, and compared to what the actual results are. Website visitors and contributors can browse the estimates submitted by other users.
We recently hosted a NYC Algorithmic Trading meetup where we discussed the potential of crowd-sourced earnings estimates as the basis for new and interesting trading strategies. I presented some validation work on claims made in a recent Estimize whitepaper with the goal of replicating the results in the new Quantopian Research Platform and providing a basis for future work. My work confirmed their previous finding – there is potential for crowdsourced earnings data to be an interesting new source of alpha, especially given that current earnings surprise strategies are almost exclusively based off the Wall Street Consensus.
The meetup clips below will give you an overview on Quantopian’s latest news and also show you examples on how to incorporate multiple sources of earning predictions into your algorithms.
Quantopian’s Latest News
Karen Rubin, director of product, gives an overview of our latest initiatives: quant-sourced hedge fund, the addition of fundamental data into our platform and our new research environment.
In this clip, I dive into Estimize, how their crowd-sourced estimates work and then shows my validation work against the claims in their latest white paper.
Sample Post Earnings Announcement Drift Trading Strategy
I walk through a basic PEAD (Post Earnings Announcement Drift) Strategy – a strategy that goes long (short) companies whose actual earnings announcements beat (miss) expectations, also knows as a positive (negative) earnings “surprise”.
I did some pre-processing to the raw data files provided by Estimize on the Quantopian Research Platform (mainly computed the Estimize consensus by averaging all the individual estimates for each reporting date) before creating the strategy described above.
Just getting started with Python? With its extremely rich ecosystem of data science tools it can be overwhelming to newcomers. In this post, I explore how to navigate and leverage the PyData jungle – by focusing on the 10% of tools that allow you to do 90% of the work. The tools I will introduce here will allow you accomplish most things a data scientist does in his day-to-day (i.e. data i/o, data munging, and data analysis).
Maximize your efficiency – click here to read the full blog post and learn more about the following tools: installation, IPython notebooks, pandas, and Seaborn.
We are hard at work building a new tool: a hosted research environment for analyzing our curated datasets, your Quantopian algorithms, and your backtest results.
For those of you who followed Quantopian’s progress the last few years, you have seen our offering evolve from a backtesting platform, to a backtesting and live trading environment.
And now we’re ready for the next step. During the course of building both of these features we have gotten lots and LOTS of requests for more flexible data access, for the ability to do custom plotting, and post-hoc analyses on backtest results. So we’re creating a whole new environment to support iterative research and data exploration.
We chose the IPython notebook as the backbone for this platform and we have just gotten started building basic APIs to access our 12+ year minute (or daily) bar pricing data set.
We are very excited about the feedback we’ve received and have decided to open up beta registrations. If you are interested in being a beta user for the research environment, sign up here or register to attend a sneak peek webinar on Tuesday September 30th to learn more.
A few weeks ago Quantopian welcomed Matt Trudeau, Head of Product at IEX, to speak at the NYC Algorithmic Trading Meetup. IEX is an Alternative Trading System (ATS) launched in October of 2013 and featured in Michael Lewis’s latest blockbuster novel, Flash Boys. Matt is part of the brain trust that built this new exchange and designed its innovative market structure.
Soon after the Flash Boys release there was a flurry of press and debate about the state of the markets and IEX. My favorite pieces included a live debate on CNBC and the 60 Minutes profile on IEX founder Brad Katsuyama. The debate was heated and contentious, and it ranged from the merits of ‘high frequency trading’ to allegations of market rigging and order front-running.
Not surprisingly, our Meetup comment thread quickly became a hotbed of discussion of the intricacies (or existence) of latency and cross-market arbitrage, with members sharing a diversity of strong opinions on our decision to give Matt and IEX the floor for a meetup. As is so often the case, cooler heads prevail at in-person events far more so than in online forums – the Meetup was lively but polite and focused. We were happy that Matt met a respectful and engaged audience of quants, traders, computer scientists and investors who were as eager to listen and learn as they were to ask tough questions. Our meetup sponsors from the CQF program were kind enough to record the full presentations by both Matt and a pre-session by Quantopian’s founding CEO John Fawcett; you can watch the full meetup in several segments below.
One of the questions I heard leading up to the Meetup was, “How did you get Matt as a speaker?” The answer is pretty simple: he responded to our Tweet about Quantopian’s ability to route orders through Quantopian to IEX. We wrote about the feature on our blog and posted the news on Twitter, which led to an invitation to visit the IEX team at their offices in NYC – and eventually to the idea of hosting a meetup so that the NYC Algorithmic Trading group could enjoy the same chance we had to hear about the technology and philosophy behind the group’s mission of ‘institutionalizing fairness.’
Introduction: Quantopian founding CEO John Fawcett gives an overview of Quantopian’s backtesting and live trading platform, company business model and near term roadmap.
Part 1: IEX Head of Product Matt Trudeau. Background on how and why IEX was started, including a primer on the ecosystem of computerized trading algorithms, from passive market making through structural arbitrage.
Part 2: IEX Head of Product Matt Trudeau. Discussion of IEX’s price matching engine and continuation of discussion on how IEX’s approach interacts with various computerized trading algorithms.
Part 3: IEX Head of Product Matt Trudeau answers the question “How is IEX doing as a company?” Spoiler alert, IEX hit an intraday high water mark of 1% of market share for the first time on the day of our meetup (8/26).
If you are interested in routing your Quantopian real-money trades to IEX, some sample code is below, and you can read more in the API documentation. Or, work with a full algorithm that uses IEX by cloning the sample algorithm in our forums.
# Import IEX exchange routing from brokers.ib import IBExchange def initialize(context): context.stock = symbol('AAPL') def handle_data(context, data): # Buy 1000 shares of Apple via IEX order_target(context.stock, 1000, style=MarketOrder(exchange=IBExchange.IEX))
The question we hear all the time from new members of the Quantopian community is, “How can I get started quickly with algorithmic investing?”
Today, we have a better answer than ever: Algorithm Builder. Algorithm Builder is a ‘quick start’ tool for building, testing and trading an automated portfolio rebalancing algorithm, without writing a single line of code!
The Algorithm Builder is a simple tool that can test any stock portfolio you build, or select a pre-built portfolio we’ve provided. You construct or modify a portfolio by selecting securities from Quantopian’s database of over 8,000 stocks and ETFs and setting their allocation weights.
With the click of a button, you can see your custom portfolio’s performance in the market over the past two years. The interface makes it easy to iterate rapidly, testing new portfolio combinations, allocations, and rebalance frequencies until you find the right recipe.
Once you have your custom portfolio, you can track the performance of the portfolio going forward. When you track your algorithm’s performance going forward you get minute-to-minute updates of your prices and overall performance. When you are ready, you can trade the algorithm with real money in the market.
Algorithm Builder rolls up the power of Quantopian’s technology into a single, intuitive tool that anyone can use. The cost of simplicity is often loss of flexibility, but that flexibility is ready and waiting in the main Quantopian platform. We are excited to hear feedback from our community of quants, programmers, and investors on how this tool might fit into their workflow, as well as how they’d like to see it extended and expanded.
In January the first customer’s dollars were traded with Quantopian’s algorithmic investing platform. In May we traded $100 million customer dollars. Of all the metrics and statistics that we have been obsessively tracking, this number stands out, blowing through even our own most ambitious targets.
Why is this number so important for us (other than the number of zeros)? Because it shows how much progress we’ve made. When we wrote about our live trading launch back in a February blog post we identified the following three key themes in our community’s questions about live trading:
Trust: Do I trust my research and my code enough to trade? Do I trust Quantopian to protect my IP and place trades as I expect?
Technology: Are all the nuts and bolts required to implement my algorithm the way I need it in place?
Trading capital: Do I have the trading capital and the risk tolerance to live trade my algorithm?
Reaching the $100m trading milestone is concrete progress towards answering these three key questions. Together with our community of quants and traders, we have tested and deployed hundreds of algorithms into the live market with more than 2000 algorithm trading-days of system operation.
Almost 150 of you have launched an algorithm that traded real assets algorithmically. Your feedback has been extremely positive, and extremely insightful; you have helped us build a better product during these past four months. For that, we would like to extend a huge thank you to all the traders who have joined our pilot program so far. Together we have designed and built valuable new live trading features like trading guards, additional order types, exchange routing and dynamic universe selection. Together we have identified simple low frequency, low cost strategies, perfect for beginners with limited trading capital, to get started with algorithmic investing before they learn to write a single line of code.
We could not be happier with the progress we have seen in the pilot program, and we are not slowing down to celebrate – in fact quite the reverse. We’re making two big announcements today:
We’re excited about this new chapter for our company, and we can’t wait to meet our new customers.
* This offer covers account balances up to $100,000. Additional (simultaneous) algorithms and larger account balances are not covered. Algorithm can be stopped, modified, and restarted as you wish. This cannot be combined with another Quantopian offer.
There have been a lot of discussions on how to develop algorithms that are compatible on both Zipline and Quantopian. We are highly dedicated to openness and providing you with flexible tools so we are happy to announce that such an effort is well under way!
We believe Zipline and Quantopian are deeply complementary. Quantopian provides a complete environment, while Zipline allows for local dev and your own toolchain. There are several advantages to using Q and Z in combination. The most obvious is that you have full control of the development environment. You may prefer to develop in your own IDE where you can also debug code for correctness and profile it to get that last speed-up. Zipline development permits that.
Once you have an algorithm that you like, you will be able to copy & paste it to Quantopian with minimal modifications, backtest it on our high quality historical data, forward test it on live data, and trade real money via your broker.
We started creation of a simple Zipline API that mimics the API of Quantopian which is now available in zipline 0.6.1.
The API can be accessed via zipline.api and currently supports the following Quantopian features:
In addition, we added a new Zipline command line interface (CLI) that makes running algorithms much easier. For the IPython notebook we also added an IPython magic (%%zipline) that will execute the algorithm defined in that cell on Quantopian with our data. This will be part of the upcoming 0.6.2 release, see here for the GitHub pull request.
The current features are missing as-of-yet:
Here is an example Zipline algorithm that shows the basic idea:
# Import Quantopian-style api from zipline.api import order, symbol def initialize(context): context.aapl = symbol('AAPL') def handle_data(context, data): order(context.aapl, 10)
You can copy & paste the above code (without the imports) directly to Quantopian and run them there.
As you can see, there is a fair amount of functionality already available and the gap between Zipline and Quantopian will continue to narrow.
Please let us know in the comment section what you think is missing or any other cool feature ideas!
Journalist-story-teller Michael Lewis ignited a frenzy of debate and acrimony over high frequency trading with the release of his book, Flash Boys. We adore his writing, and his singular ability to shine a spotlight on esoteric fields. His book has made the arcane, complex, and sophisticated field of ‘high-frequency’ trading dinner table talk across America. While the level of discourse has ranged widely, from technical critiques of market microstructure, to downright theatrical showdowns on the cable news networks, we believe in the power of transparency.
For those of us in the financial services or investment management fields, there was arguably not much ‘new news’ in Lewis’ Flash Boys – the financial incentives to find and exploit latency (or any type of) arbitrage in public markets have always been and will always be considerable. In the best of worlds this is a good thing, ruthless competition to exploit inefficiencies should minimize those same inefficiencies with all market participants benefiting from faster, cheaper order execution. The problem arises when, through regulatory oversight or incompetence, we allow conflicts of interest to form within our capital markets such that inefficiencies are not minimized through competition, but are allowed to balloon in a self-reinforcing manner.
One might argue that Flash Boys came late to the HFT party, and market forces had already begun to deflate the balloon of profits that could be made (at least in US markets) from latency arbitrage. And yet, anyone who would dismiss the signs that the ‘investing public’ is becoming an increasingly well-educated, technologically savvy, and demanding customer base with a passionate interest in the fairness of their financial markets is not paying attention.
At Quantopian, we believe that broader interest in capital markets will lead to more educated investors, and that market forces will continually drive creative solutions to anomalies such as latency trading. Therefore, we are extremely pleased to be able to deliver new functionality to our customers whereby orders placed with Quantopian algorithms can be routed to the IEX trading venue for execution. IEX is a stock trading platform launched late last year with the express goal of negating latency arbitrage by introducing a delay of 350 microseconds in the execution of trades. If you aren’t already managing your algorithmic trading with Quantopian you can test out a basic investment strategy for free*, or to learn how to route the trades from your existing account to IEX check out a sample order.
We fully expect the conversation on fairness and transparency in the US stock market to continue to evolve, both at the regulatory level and in the court of public opinion. From our vantage point the inexplicable lack of automation and algorithms in the investment process is an even bigger target for reform than market microstructure. While trading has become essentially automated (albeit with bumps along the way), asset allocation and portfolio management remain stubbornly manual and by extension artificially expensive. The premium investors today are paying for even the most formulaic portfolio management services can be on the order of 1-2% per year, a rate which frankly dwarfs the per-investor costs of something like latency arbitrage. At Quantopian our mission is to continue to put the power in the hands of investors to help them drive down costs while getting superior performance from their ideas and we think that mission is well served by routing trades to IEX and doing our part to promote increased transparency and fairness in our capital markets.
*Live trade with Quantopian by May 19th and we’ll give you two years of free access for accounts up to $100,000.