Category: New Features

Using the QuantConnect Charting API

We’re pleased to announce the release of a new charting API which lets you create flexible, dynamic charts from your backtest. The charts stream to your browser as the backtest is running and can be configured in many different ways. It is a very simple API, allowing you to create custom charts with just 1 line of code. The minimal usage plots a second line on your strategy’s equity chart. It can be accessed like this:

//Minimum code required for custom plotting:
Plot(string seriesName, decimal/int/float value);
//Example using the 'Strategy Equity' chart by default.
Plot("Portfolio", Portfolio.TotalPortfolioValue);
Custom line plot stacked with your strategy equity.

Custom line plot stacked with your strategy equity.

With just one extra parameter, the chart name, you can also create your own chart and place any series onto it you wish:

//Create your own charts by specifying a chart name:
Plot(string chartName, string seriesName, decimal/int/float value);

Underneath the Plot() function are two key classes: Chart and Series. The Chart class is the canvas you’d like to draw on, it can be set so the Series are Stacked or Overlayed. The Series classes are the data on the chart, they default to Line plots but can be set to be Candles or Scatter. Below is an example of creating a customized chart and plotting our trades on top of the asset price:

Plot prices with trades to see where your algorithm is working.

Plot prices with trades to see where your algorithm is working.

//Our custom chart, id: "Currency Plotter", Overlay the series.
Chart plotter = new Chart("Currency Plotter", ChartType.Overlay);
//Line series for our EURUSD pricing.
plotter.AddSeries(new Series("EURUSD", SeriesType.Line));
//Scatter-series for our BUY-orders.
plotter.AddSeries(new Series("Buy", SeriesType.Scatter));
//Scatter-series for our SELL-orders
plotter.AddSeries(new Series("Sell", SeriesType.Scatter));   
AddChart(plotter); //Add the Chart to our algorithm

Once you’ve setup your custom chart you can access it with the Plot() function.

Plot("Currency Plotter", "EURUSD", price);      // Save End of Day prices.
Plot("Currency Plotter", "Buy", purchasePrice); // Plot purchasing prices.
Plot("Currency Plotter", "Sell", salePrice);    // Plot sale prices.

The SeriesType enum controls the style of a series. Data passed into candle plots gets automatically converted into Daily or Weekly candles depending on the quantity of data. Because of technical limitations of working in a browser all series are capped at 4000 samples. If you find your browser slowing down try sampling less!

Class Chart(string chartName, ChartType type);
Class Series(string seriesName, SeriesType type);
Enum ChartType { Overlay, Stacked }
Enum SeriesType { Line, Scatter, Candle }

Putting it all together the results are fairly exciting, we hope you’ll enjoy! To get you started we’ve made a demonstration algorithm which generates the charts below. Clone it and copy the bits you like into your algorithm.

Daily Data Updates, GIT Integration!

Thank you all those that have signed up and lent your support to QuantConnect. We are growing fast and appreciate your feedback. As a thank you, during July we’re giving away free 12 month licenses. If you’d like your free license just leave a request in the forums.

Thanks to your feedback – we’re happy to announce three major new features!

1. Daily Market Data Updates

After a few long nights of coding we’ve finished adding daily data updates to the QuantConnect backend, so now you can tap into the US Equities, and FX currency pairs tick data right up until Today-1. To use up to date data simply use: SetEndDate(DateTime.Today.AddDays(-1)); High quality data provided by QuantQuote and FXCM.

2. GIT API – Use your favorite IDE

QuantConnect is now fully integrated with GIT version control. Code your algorithms using your favorite developer tools, and commit your changes to GIT. We automatically run your backtests and email you the results.  After you commit code back to the server we automatically build it, run a backtest and email you the strategy results. If you check out a copy of our open-sourced code you can compile your algorithm on your desktop. Continue reading

US Equities And FX Tick Data Ready!

After months of work, and lots of coffee we’re proud to announce for the first time ever, tick data, a coveted asset of the financial industry is available through QuantConnect. We have every single trade on 16,000 stocks going back to 1998, along with 11 major currency FX pairs since 2007.

The IDE is faster than ever with a cluster of hundreds of machines running for your backtests: a 5 year tick simulation completes in about 60-120 seconds, and minute and second resolution candle complete much faster. This blistering speed is normally reserved for mega-quant funds and retail has never seen anything so powerful.

We’re grateful to our data providers, QuantQuote, and FXCM, thank you for giving us the highest quality data possible. In total it is 4 terabytes of data, entirely at your disposal. And, as always and forever, we’ve made it completely free for you.

To help you navigate, and give you some code examples to kick off we made the Data Library. Here you can copy-paste some code snippets to use the data.

Last week Simon interviewed Tadas Viskanta of Abnormal Returns, and FOREXThink interviewed Jared on the future of finance. We also finished the API documentation so you can dive in!

There’s a lot going on, so why don’t you drop us a line on the forums and we’d be happy to help –

Jared, Shai, Gustavo, Paul and Simon.
The QuantConnect Team

First New Data Set! Estimize Crowd Sentiment Data!

In our aim to provide you with the best quality, institutional level data we’re now working with to bring you crowd-sourced earnings estimate data.

Each financial quarter companies publish their earnings per share (EPS) and revenue figures to investors. When a company performs worse than expected, often the share price can fall dramatically, and vice versa.

Each time there is an earning announcement the community of 13,000 users makes predictions on what the Earnings Per Share (EPS) will be, along with the Revenue for the quarter. On average they are more accurate than Wall Street analysts 69% of the time!

For the first time you can freely use historical sentiment data to design trading algorithms! With QuantConnect you can now access estimates from the crowd into your algorithms to design powerful sentiment strategies. Imagine testing how a bad earnings announcement affects the stock price!

In your Initialize() Method:

AddSentimentData(SentimentDataType.Estimize, "IBM");

And then handle the events using the OnEstimize() handler:

public override void OnEstimize(Dictionary<string, Estimize> estimates) {
//Incoming IBM Estimate
Debug("IBM EPS:" + estimates["IBM"][0].Eps+" Rev:"+estimates["IBM"][0].Revenue);

See the full documentation at

© 2017 QuantConnect Blog

Democratizing algorithmic investments Up ↑