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.
Along with many other sites on the internet, Quantopian is taking steps to protect ourselves from the “Heartbleed Bug“, which was disclosed yesterday. Although we have no reason to believe that our site or any of our members’ accounts or data have been compromised, we are taking a number of precautions to safeguard the security of our members’ accounts. We will be documenting here the steps we are taking.
[DONE] We are generating a new SSL certificate to protect our site, using a newly generated encryption key; deploying the new key and certificate to our servers; and asking our SSL certificate authority to revoke our old certificate.
[DONE] We are adding a prominent banner within our application notifying all members to change their passwords. The banner will go away automatically when the user’s password is changed.
[DONE] We are requiring all members who have brokerage accounts configured within Quantopian to change their passwords.
[DONE] We are modifying our application so that members are not able to configure a brokerage account within Quantopian until they have changed their password.
[DONE] We are rotating the passwords and encryption keys used by the components of our application when they are communicating with each other. This requires application down-time the evening of April 8, 2014, starting at 5:00pm US/Eastern.
[IN PROGRESS] We are generating new encryption keys used to protect data in our databases and re-encrypting all data using the new keys.
Quantopian founder and CEO John “Fawce” Fawcett was invited by Reddit’s investing subreddit to host an AMA (Ask Me Anything). The turnout was overwhelming! With over 90 comments in the thread, we’ve pulled out the highlights. Take a look below at the conversation summary:
Q: How much computer coding ability must one have to use this well?
Fawce: You don’t need to be a coding expert to work on an algorithm in Quantopian. Some algorithms can be coded up with some fairly basic logic, stuff that you’d learn in early stages of a programming class. The more intricate your logic, or the more advanced your mathematical operations are, the more you’re going to need advanced skills.
We think that algorithm collaboration (upcoming new feature) is going to help with this quite a bit – people with great ideas will be able to pair with people with more coding skills, and they can collaborate on a result. We also think there is a future in renting of algorithms.
If you’re already pretty decent at Python, I highly recommend Wes McKinney’s book on pandas. He’s one of our advisors, and he’s done a ton of work to make complex mathematical operations easy in Python.
Q: Do you guys have any plans to integrate company financial data for the fundamental investors?
Fawce: Yes, we definitely do. We get this request all the time, and we are chomping at the bit to deliver it. Company financial data appeals to more than just fundamental investors, too. We think that algorithmic trading has three steps – data exploration, coding/backtesting, and live trading. We built the the backtester first, then we did live trading, and data exploration is next.
Q: Written any good algorithms yourself?
Fawce: I worked with a few other people to write the algo that is trading Quantopian’s money right now, which we shared with the world: https://www.quantopian.com/posts/paper-trading-with-interactive-brokers-open-beta-launch
I love algo ideas that model relationships between securities, the simplest of which is pairing. I also like Ernie Chan’s explanations of these types of trades, so I wrote a co-integration algo on gld/gdx. More recently, another quant posted Ernie Chan’s EWA/EWC pair trade. His implementation is cool because it also uses a Kalman filter: https://www.quantopian.com/posts/ernie-chans-ewa-slash-ewc-pair-trade-with-kalman-filter?c=1
Q: What does your pricing model look like?
Fawce: Right now, everything is free. We’re focused on bringing the community together, and we’re talking to our current live traders about pricing.The basic structure will be: – backtesting and forward testing are free – trading through your broker will be $TBD/month/algorithm.
Q: any chance you’ll offer I/B/E/S data, maybe for an extra cost?
Fawce: Yes, we’re talking to a number of data vendors about estimate data. I see fundamental corporate data as breaking between historical data from filings and forward estimates. I’m a huge fan of Estimize, and I think they are part of a major trend to use crowdsourcing to improve data origination and data quality.
As our community continues to grow, one way to draw more data to the platform is to become a sales channel for the data providers. I think that core data like historical filings needs to be free for research and testing, but that freshly delivered data used in live trading can be fee-based.
Q: How much AUM is currently being managed by Quantopian-hosted live-trading algorithms?
Fawce: This is really the question about our platform today. I have to be a little bit vague, because we haven’t spoken about total assets under management (AUM) publicly yet, and it is one of the best hooks we have for news coverage. I’ve actually started referring to the total as our “Algorithmically Directed Assets” or ADA since we aren’t a broker or fund manager and don’t hold your account.
We’re trading through 30 IB accounts today in private beta. I feel very comfortable that we are getting both sufficient technical burn-in and that we are directing a meaningful amount of capital. At the moment, the bottleneck for ADA growth seems to be algorithm development. But we know people are digging in, because we’ve seen a significant jump in the amount of coding/backtesting/paper trading over the past few weeks following our announcement of live trading.
Q: I love the things you are doing! How many developers did you initially start out with? Did you start doing the coding (yourself?) before venture capital started rolling in? Or how did the launch come along? … Do you feel that your hosting is latency sensitive (yet?)?.. I am just wondering how you go from idea to working with something so awesome
Fawce: My wife was able to support our family for the first phase of Quantopian’s existence, so I was able to invest the proceeds of selling my last company into Quantopian. To keep costs low I set up for work in our shed. I wrote the original prototype myself, and the first website drew a good initial audience after a few blogs mentioned it.
I started in June of 2011, and around November it started to get really cold in the shed, so I figured I should try to get some funding so I could get a real office :). I met Spark Capital around then, and they lead our seed round in January of 2012. Then I hired my CTO, and we worked together for about 6 months re-writing the prototype to be “real”. But, we didn’t get our office until June of 2012 when we wanted to ramp up our team. Instead, I worked from the public library in my town through the winter :).
Everything is hosted on amazon. We’re specifically avoiding HFT, so latency of 1-2s is our target. We see much less than that.
If you have passion for an idea, it will gain momentum when you talk to other people about it. I also relied on the opinions of others – my wife, friends with experience starting companies, friends from finance, and a few mentors.
Working alone from the shed and public spaces was a humble start, but it still felt awesome in the beginning. Starting up is a thrill, and each milestone feels epic – loading a month of historical trade data seemed incredible when I did it the first time. And when the first really avid user who started emailing me feature requests, I was dizzy with excitement. Same with hiring people. You have to really enjoy each step so that you can weather the setbacks. We had to make it through losing to big companies in recruiting, realizing we couldn’t afford all the data purchases we wanted to make originally, and live trading being way harder than we expected. Thanks for asking!
To see the full conversation thread, click here.