Frequently Asked Questions
We hope this page answers most of your questions about Quantopian, from purpose to technology to data. For more detailed coding documentation, please see the Documentation. If your question is not answered below, please feel free to post a question in our community, send us an email, or click the Feedback button in the page header above.

What is Quantopian?

Quantopian is the first algorithmic trading platform in your browser. Write (or clone) an algorithm; test it against 11 years of US stock data; paper trade it against live data; and then trade the algorithm through your brokerage account. Quantopian also hosts a community where members can ask for help, share ideas, discuss code, and share data. Members can learn from each other and work collaboratively.

There are more answers about Quantopian in the About Quantopian section below.

Is Quantopian free?

Quantopian's community and backtester is free for everyone to use. There will be a charge for connecting your algorithm to your brokerage. Pricing isn't finalized, but we're considering a flat monthly fee.

Who owns my algorithms?

You own your algorithms. Everything you write is yours. Quantopian does not own your algorithms; you do.

Are my algorithms secret?

Your algorithms are kept secret. We are committed to protecting your intellectual property and keeping it safe. Ideas are some of the most valuable assets anyone has. We take this responsibility to our members extremely seriously.

If you choose to do so, you can share your algorithm so that others can see it. If you choose to share an algorithm, it is still owned by you, but it is obviously no longer a secret. A shared algorithm can be used and adapted by others.

Certain Quantopian employees can see your algorithm in very specific situations, such as when providing technical support or resolving a site stability issue. Our Terms of Use goes into greater detail about these exceptions.

How do I get started?
  1. Click here to see a basic algorithm.
  2. Click the 'Clone Algorithm' button.
  3. Click the 'Build Algorithm' button. You'll see the backtest running in the right-hand panel. Now customize your algorithm!
  4. In the algorithm, see how it says 'sid(24)' - that's Apple. Delete the '(24)' and type your favorite company name. See the auto-complete? Again, it's easy!
  5. Click the 'Build' button. You've just tested your own, customized algorithm!
Live Trading
How can I open an Interactive Brokers (IB) account?

Navigate to the Interactive Brokers website and select your account type. Most people open an Individuals account to get started. If you have questions about the application process or creating an account, contact IB's Account Services Group at (312) 542-6856.

Interactive Brokers LLC is not affiliated with and does not endorse or recommend Quantopian, Inc. Interactive Brokers provides execution and clearing services to customers who integrate their Interactive Brokers account with their Quantopian account. For more information regarding Interactive Brokers LLC, please visit www.interactivebrokers.com.

How do I add an IB account to my Quantopian profile?
  1. Go to your Quantopian trading profile
  2. Enter your account nickname (a name used on Quantopian), broker username, and account number
  3. Navigate to the My Algorithms tab and live trade your algorithm to the market
How do I create an IB demo account to paper trade?

Interactive Brokers allows one free demo (paper trading) account per real money account. A demo account simulates the real market under no risk to the trader.

To set up an IB paper trading account go to Interactive brokers and navigate to: Account Management > Manage Account > Settings > Paper Trading.

Once the paper trading account is created, you can enter your credentials in your Quantopian trading profile and deploy to the market to test your strategy.

Can I add another algorithm to my existing IB account?

Only one live trading algorithm can be run per IB real money account. To launch a second live trading algorithm, you will need to create a separate IB account.

Why did I get logged out of my IB account?

IB only lets you login from one location at a time. Quantopian needs to be logged in to your IB account in order to trade. That means you can’t log in with your IB account from another location while a Quantopian algorithm is trading. When you login to IB through Quantopian you stay logged in continuously, day after day, saving you the trouble of a daily login process.


Live Trading IB Accounts

If you have an algorithm deployed on Quantopian and decide to simultaneously login to WebTrader or TWS with the same account, then IB will log you out. This will terminate the Quantopian login to IB, and Quantopian will not be able to trade.

To manage this, IB permits you to create a second login for your IB account. You can use the second login if you want to login to TWS or WebTrader to monitor your account. Adding a second user to your IB real money account is straightforward and can be done at no cost.

Simply log in to Interactive Brokers and navigate to Manage Account > Access Rights > Users > Add 2nd User. For more detailed instructions, click here.

If you have any trouble with the user addition process, you can reach IB Pro Services at (203) 618-7791 ext. 2


Paper Trading IB Accounts

Unlike real money accounts, IB does not allow you to add additional users to demo accounts. During trading hours, you cannot monitor your IB demo account with TWS or WebTrader without interfering with your Quantopian algorithm.

If you attempt to login via TWS or WebTrader during market hours with the account configured in Quantopian, Quantopian will not be able to place trades. Quantopian will attempt to reconnect, which will log you out of TWS/WebTrader. If you need to log in to your paper account, you need to stop your algorithm first. To stop your algorithm, go to My Algorithms page, select your algo and press the 'Stop Algorithm' button.

If you login to WebTrader or TWS after market hours you will not interrupt any trading activity and Quantopian will automatically reconnect to your IB account in the early morning hours before market open.

How do I add an additional username to my IB real money account that is dedicate to my Quantopian algorithm?

Adding a second user to your IB real money account is straightforward and can be done at no cost. Simply log in to Interactive Brokers and navigate to Manage Account > Access Rights > Users > Add User

If you have any trouble with the user addition process, you can reach IB Pro Services at (203) 618-7791 ext. 2

What happens when I start (or stop and re-start) a live algo against an IB account with existing positions?

The algorithm will synchronize all existing positions from your IB account into the Quantopian live trading dashboard. You will see the price update for all existing positions and be able to monitor your entire portfolio of US equities.

How do you handle margin management and margin calls?

Margin is handled by the broker. Here is an overview of the Interactive Brokers margin requirements.

What currency do you support?

The pilot program only supports IB acocunts with USD for the base currency. If you want to use an additional currency, you can add it as the funding currency to your IB account.

If you have an institutional IB account, you can create a separate base currency for each sub-account.

Data Sources
What data does Quantopian have?

We currently provide minute-level bar data of all US stocks from January 2002 through the previous trading day for backtesting. The previous day's data is uploaded every night.

Minute-level bar data consists of the high, low, open, close, and volume for each minute that a stock is traded.

The data includes all companies that were traded, including companies that have subsequently gone out of business. This is very important in order to avoid survivor bias. Without this complete data set, your algorithms would be be blind to the possibility of bankruptcy and the resulting losses.

For paper trading and real-money trading, we get a realtime feed of trades from Nanex's NxCore product. Those trades are bundled into one-minute bars and fed to the trading algorithms. Paper trading data is provided on a 15-minute delay. Real-money trading is processed without delay.

Do you support Forex? Options? Futures? Bonds? Non-US securities?

At this time, no. The only data we have is US stocks and ETFs.

We plan on adding more data sources in the future. Please give us feedback and let us know what data you are looking for.

We also plan on making it easy for our members to add and share their own data sources. We'd like to see what data ideas the community can come up with.

Why is your close price different from other data sources?

Quantopian uses the last traded price as the close price for the security. Depending on the data source, others may use end-of-day (EOD) prices. For example, Yahoo is an EOD datasource. Yahoo and other EOD data providers get their price and volume data from the official exchange record. Quantopian's data is generated by the actual trades, regardless of what exchange the trade was made on. The EOD sources rarely exactly match data derived from intraday data. For instance, the official close for a NYSE stock is the last trade of the day for the stock on NYSE. But if the stock also trades on Chicago, Pacific or another regional exchange, the last trade on one of those exchanges could be our close.

Writing an algorithm
How do I write an algorithm?

If you haven't seen it yet, How Do I Get Started has the basic steps. For more information, see this short overview of how to clone and edit algorithms easily. See this longer, 4-minute video if you would rather write your first algorithm from scratch.

I hate watching videos. How do I learn how to write an algorithm?

Our Quantopian documentation goes into great detail about what functions are available. Between the functions and the examples, you should have enough to get started.

How do I learn how to write Python?

We don't have any Python resources ourselves, though we're thinking about ways to help our community be better Python programmers. Until then, you should take a look at Python tutorial, Dive into Python, and Learn Python.

Where do I get an idea for an algorithm?

Our best advice is to go to the community and see what they've done, and innovate on top of someone else's idea. If you're still stuck, write a new post in the forums - you might find someone with an idea who would like to collaborate with you.

What libraries does Quantopian support?

Only specific, whitelisted Python modules can be imported. If you need a module that isn't on this list, please let us know.

  • bisect
  • cmath
  • collections
  • copy
  • datetime
  • functools
  • heapq
  • itertools
  • math
  • numpy
  • operator
  • pandas
  • pytz
  • QSTK
  • Queue
  • random
  • re
  • scipy
  • sklearn
  • statsmodels
  • time
  • zipline
  • zlib
I don't know Python. Can I use R, MatLab, or Excel?

Unfortunately, no, you can't. We're only supporting Python and we have no plans to support another language at this time. The good news is that Python is reasonably simple and very powerful. You won't have much difficulty porting your work into Python. If you get stuck, ask the community for help. You'll find them very happy to help.

Your IDE is new to me. Can I use my own development environment?

You can use any IDE that you'd like, but in the end you need to paste the code into our IDE to run a backtest. Give our IDE a try, though, and we think you'll like it. There are many smart auto-complete features that make writing a backtest easier. We've done a lot of work to put in smart error messages that will help you debug. And you can't beat the feedback loop. Press the build button (or just control-B on your keyboard) and you'll see a quick backtest run immediately - you can't get that in your IDE.

If your heart is set on using your own development environment, take a look at Zipline. Zipline is our backtester, and we have open sourced the code. If you want, you can connect Zipline to a data source and use your own development environment.

Can I have a copy of your data?

Unfortunately, we cannot do that. We license the data from a third-party vendor. Our license permits you to use the data, but it does not permit us to give you a copy of it.

Backtesting
How does the backtester work? What is the difference between minute-level and daily-level backtests?

In minutely mode, our backtester runs an event loop (handle_data()) once per historical minute. Every run of the loop loads the data for that minute and executes your algorithm. If the algorithm calls for a buy or a sell, that order is placed. If there are any open orders, the backtester attempts to fill them. (Note, an order that is placed in one event loop is not filled in that loop; it is filled in the next loop. That prevents any look-ahead bias from leaking into your algorithm.)

You can choose to run at minute or daily level of granularity. The only difference is that in daily mode, the backtest runs one event for every day of available data. Daily level data is simply the aggregation of the minute level data.

How are filled orders calculated?

This is a very complex area, and there is no 'right' answer. It's impossible to say for sure what impact an order would have had in some alternate history where your algorithm was running.

Our backtester makes its best effort to calculate the realistic impact of your orders on the execution price you receive. When you place an order for a trade, your order affects the market. Your buy order drives prices up, and your sell order drives prices down; this is generally referred to as the 'price impact' of your trade. The size of the price impact is driven by how large your order is compared to the current trading volume. The backtester also evaluates if your order is simply too big: you can't trade more than market's volume, and generally you can't expect to trade more than a quarter of the volume in any minute. All of these concepts are wrapped into the backtester's slippage method.

You can control how this is applied within your algorithm. Learn more about this in our Quantopian documentation.

What benchmark does Quantopian use?

When you run a backtest your algorithm is compared to a benchmark. The benchmark is the price return of an ETF designed to match the S&P 500. In the future, we plan to make that benchmark configurable so you can choose the benchmark appropriate to your algorithm, including a value-return version of the S&P 500.

What is the difference between the 'build' backtest in the IDE and the full backtest?

When you 'build' your code in the IDE, that runs a backtest. A full backtest is essentially the same, but it permits you to see a lot more detail - deeper risk metrics, position information, transactions, and more.

Can I customize the Quantopian backtester?

Yes, you can! Quantopian's backtester is released as an open source project called Zipline. If that's where your passion lies, you can clone our code and modify it as you see fit. If you make a change that you think others would like, we'd be delighted to have you pass the change back to us.

How does your data track stock splits, acquisitions, mergers, spinoffs, and dividends?

We adjust our data to take into account corporate actions. We use 'adjusted close prices.' That means that the effect of all stock splits and merger activity are applied to price and volume data. As an example: The stock you're looking at is trading at $100, and has a 2:1 split. The new price is $50, and all past price data is retroactively updated 2:1. In effect, that means you can ignore stock splits unless the stock you are looking at will split in the near future - as soon as it does, that will be applied retroactively to all data.

As an example, you can see this backtest using IAC. That company had a stock split and a spinoff, and the graph shows the adjusted close prices retroactively. Without the adjusted close prices, your algorithm would be misled by the price changes.

Dividends are applied differently. On market close of the dividend ex-date, the value of the stock is marked down by the amount of the dividend. On the dividen's pay date your portfolio cash is increased by the amount of the dividend.

Privacy and Security
Is my algorithm secure?

We take privacy and security extremely seriously. We will never access your algorithm unless we are helping you troubleshoot issues.

From a technical perspective, we have a number of security features in place. We never store your password in plaintext in our database. We require SSL encryption for the Quantopian application. We require secure websocket communication for all backtest data.

All trading algorithms in our database are protected by 256-bit, salted AES block-chaining encryption.

We never save the password of your brokerage account.

About Quantopian
How does Quantopian make money?

Currently, the use of Quantopian is free of charge. In the future we plan to charge for live trading, when you trade your algorithms through your brokerage account. It is our intent to keep the backtester and data free of charge.

If you don't charge yet, how are you paying for this?

Quantopian has received funding from Khosla Ventures, Spark Capital, GETCO, and angel investors. We're using that investment to build the backtester you see today, and we hope to turn it into a profitable business in the future.

Who is Quantopian?

Quantopian was founded by John 'Fawce' Fawcett and Jean Bredeche. Fawce previously founded Tamale, which was acquired by Advent Software. Jean has worked at several startups including Tamale, where he met Fawce, and HubSpot.

You can read more, including our LinkedIn profiles, social media accounts, and code repositories on our About Us page.

What's your roadmap? When can I live trade?

We're working on several aspects of the website. We continue to improve the backtester, improve the community, improve the IDE, and add new data sources. We have a pilot group of customers doing live trading today. We hope to have an open beta for live trading in early 2014.

Is this high-frequency trading?

No, it's not high-frequency trading. High-frequency traders are trying to shave milliseconds off order times and microseconds off of trade times. Quantopian is aimed at much more low-frequency trading. Our trading is on the minute level at the fastest, and most algorithms we test have position hold times for several days.

Do you have a paid support offering?