Back

[New Feature] Quandl Data Importing

You can now import Quandl data with a single line of code! Just tell us what Quandl-Code you'd like and we'll connect to the Quandl API, and import the data into your algorithm! The example below imports the Yahoo S&P index!

With this feature you can now import tens of thousands of different datasets from Quandl's library:
//Import desired data in Initialize()
AddData("YAHOO/INDEX_SPY", Resolution.Minute);

//Event handler for Quandl data
public void OnData(Quandl data) { ... }
Update Backtest






The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.



Great addition!
Is there any document listing QuandlCodes for different securities/ETFs/futures/etc. ?
0

Its virtually everything here: https://www.quandl.com - there are millions of datasets. The quandl codes are in the top-right corner of the page.

We look at the headers on the file - so as long as the data starts with a header you'll be able to access it under the Quandl object.
0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


The AddData/OnData(Quandl) does not seem to work if I want to download and analyze multiple fundamental characteristics of the same or multiple stocks. For example:

string dividendCode = "SEC/AAPL_COMMONSTOCKDIVIDENDSPERSHAREDECLARED_Q";
string freeCashFlowCode = "DMDRN/AAPL_FCFF";

AddData(dividendCode, Resolution.Daily);
AddData(freeCashFlowCode, Resolution.Daily);

does not seem to make sense, since AddData expects stock symbol as first parameter.
0

The "DMDRN/AAPL_FCFF" doesn't exist on Quandl. But I've made an example of importing two SEC types here.

I think the issue you might have been seeing is because those non-trade-bar data types need a special type to tell QC what the value column is -- in this case its "Value". See my example below.
1

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


I was trying out this example, just changed the quandl code to "NASDAQOMX/OMXS30" (index of top 30 euquities on the Swedish market) and the . But it gave me a runtime error with the following error message: 

Error invoking NASDAQOMX/OMXS30 data reader. Line: 2011-05-03,1153.87,1162.0,1146.72,2915165471708.0,0.0 Error: Property with name 'close' does not exist. Properties: Time, Symbol, Value index value, high, low, total market value, dividend market value

And this Stacktrace:

at QuantConnect.Data.DynamicData.GetProperty (System.String name) [0x000c5] in <3b12344d871e4a1380e99c39d4cddf0b>:0
at QuantConnect.Data.Custom.Quandl.Reader (QuantConnect.Data.SubscriptionDataConfig config, System.String line, System.DateTime date, System.Boolean isLiveMode) [0x000ff] in <3b12344d871e4a1380e99c39d4cddf0b>:0
at QuantConnect.Lean.Engine.DataFeeds.TextSubscriptionDataSourceReader+<Read>c__Iterator0.MoveNext () [0x000a7] in Lean.Engine.DataFeeds.TextSubscriptionDataSourceReader+<Read>c__Iterator0.MoveNext () [0x000a7] in <2824cfe7150d4525ab66e90816c767c3>:0

 

Seems strange to me, 2011-05-03 is not even i the period of the sample code?

 

 

0

Hi Mikael Lindgren,

The error massage, as always, gives you the clue to find the solution.

The default Quandl constructor uses ‘close’ as its value column, but this data hasn’t a close column, instead the value column name is 'Index Value'.

Check the line 42 in the attached backtest.

1

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Hi Jared, is there an easy way to import the Quandl data into a python algorithm, without writing a custom class, similar to the code that you demonstrated:

AddData("YAHOO/INDEX_SPY", Resolution.Minute);

0

https://github.com/QuantConnect/Lean/blob/master/Algorithm.Python/QuandlImporterAlgorithm.py

Without writing a custom class is only possible when there is a Close column

0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Thank you. Could you please post an example of writing a custom class. The data I am requesting has a "close" column instead of a "Close" column so the standard Quandl import does not work. I have also looked at the documentation on importing custom data, but it did not help me to solve the problem. For example, I am trying to import WIKI/NVDA.

0

https://github.com/QuantConnect/Lean/blob/master/Algorithm.Python/QuandlFuturesDataAlgorithm.py#L56
0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed