Building Your Own Algo, on a Browser

Are you a quant or an investor hankering to build your own algorithm?

Not long ago that was nearly impossible because of the limitations of access to clean data and back testing infrastructure and laborious startup coding requirements.

Today, however, Quantopian, a private company in Boston, is providing the browser-based tools, capabilities, education and community support (for what it calls the Quantopian community) needed to create and back test trading algorithms.

Building back testing in the past was typically a lot of work,” Dan Dunn the company’s vice president of Product and Community said in a webinar Tuesday.

With Quantopian’s Zipline back tester, an open source piece of programming, creating the ability to run algos against historical market data may take of hours instead of days or weeks, Dunn says.

First, the system user can write his own algorithm, in Python, using Quantopian’s interactive development environment (IDE), on the website. Another way to get started is to browse the Community for comments and content from members. When you find an algorithm you think is interesting, click the ‘clone algorithm’ button.” That will create a copy for you to hack!” the website says.

The user then goes to the initialize function that sets any data or variables that the algorithm needs.
For instance, you can define the security (or securities) you want to back test.

In a specified field, the user types in a target company. Then, click a ‘build’ button. And then the algorithm is tested against that security, Quantopian says.

Next is the handle-data function.

“That’s where the real work is done,” says Dunn. “A minute bar is a summary of the trading activity for a security for a one-minute period, and gives you the opening price, closing price, high price, low price, and trading volume during that minute. Our U.S. equity set is point-in-time, which is important for backtest accuracy. Since our event-based system sends trading events to you serially, your algorithm receives accurate historical data without any bias towards the present; mavg(days) calculates the moving average of the security’s price over the given number of trading days; returns() calculates the returns since the end of the previous trading day while stddev(days) calculates the standard deviation of the security’s price over the given number of trailing trading days. Standard deviation is calculated using Bessel’s Correction.”

The tools just came out of beta testing and aren’t used in trading yet.

“When the product is more full-featured we expect to institute a fee structure linked to live trading of algorithms,” says Dunn. “As we add other data sources for futures, options, foreign exchange, fundamental data, and more – we will probably resell that to our members. We don’t plan on ever charging for the data we provide today. The second way we plan on making money is on live trading. When you are able to use Quantopian to hook up to your brokerage and execute live trades, we plan on charging for that service. The exact mechanism of that fee is not year clear.”