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
//Event handler for Quandl data
public void OnData(Quandl data) { ... }
Nik milev
Jared Broad
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.
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.
Valery T
Jared Broad
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.
Mikael Lindgren
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?
JayJayD
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.
Anton Esterhuyse
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);
Jared Broad
Without writing a custom class is only possible when there is a Close column
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.
Anton Esterhuyse
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.
Jared Broad
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.
Sebastien Winsor
If you can't create a custom class in research, then I imagine you cannot
Sebastien Winsor
Actually, try
qb.AddData(Quandl, "YAHOO/INDEX_SPY", Resolution.Minute)
Quandl.SetValueColumn("Settle")Alexandre Catarino
SetValueColumn is not an attribute/member of the Quandl class.
We have received this email last year:
"On June 30, 2017, we will remove two databases from Quandl: GOOG and YAHOO. Unfortunately, the source data will no longer be available to us, so we cannot continue to offer it on the site."
So we are not able to get YAHOO/INDEX_SPY in Research nor Algorithm Lab.
That said, we are working on getting custom data into Research Environment at QuantConnect.com since Research Environment doesn't have access to the internet for security reasons.
Apollos Hill
hi everyone am i doing somehting wrong? Trying to get DXY data from www.quandl.com/data/BCIW/_DXY-US-Dollar-Index-DXY
Backtest Handled Error: Error downloading custom data source file, skipped: RemoteFile: Csv https://www.quantconnect.com/api/v2/proxy/quandl/api/v3/datasets/BCIW/_DXY.csv?order=asc&api_key=JjAt5_5Ggmmoe5zUKipm Error: The remote server returned an error: (403) Forbidden. (Open Stacktrace)
This is my code
self.AddData(Quandl, "BCIW/_DXY", Resolution.Daily)
Alexandre Catarino
That error message is shown when we don't have access to that security (BCIW/_DXY) because it does not exist or the API key (JjAt5_5Ggmmoe5zUKipm) does give us access to it.
It is odd that you are trying to fetch BCIW/_DXY-US-Dollar-Index-DXY with
self.AddData(Quandl, "BCIW/_DXY", Resolution.Daily)
it not be
self.AddData(Quandl, "BCIW/_DXY-US-Dollar-Index-DXY", Resolution.Daily)
Benjamin Ettinger
To piggyback onto this old thread, is it possible to add multiple columns from one Quandl table? E.g.:
MyAlgo(QCAlgorithm): def Initialize(self): self.onemo = self.AddData(Quandl1moRate, "USTREASURY/YIELD", Resolution.Daily, DateTimeZone.Utc, True) self.oneyr = self.AddData(Quandl1yrRate, "USTREASURY/YIELD", Resolution.Daily, DateTimeZone.Utc, True) class Quandl1moRate(PythonQuandl): Â Â Â Â def __init__(self): Â Â Â Â Â Â self.ValueColumnName = "1 mo" class Quandl1yrRate(PythonQuandl): Â Â Â Â def __init__(self): Â Â Â Â Â Â self.ValueColumnName = "1 yr"
This doesn't seem to work for me. (I get "Trying to dynamically access a method that does not exist throws a TypeError exception.")
Stefan d'heedene
Hi Benjamin, I was able to add two columns of the same table before in my code (similar to what you wrote above), without getting any exceptions. The problem though is distinguishing what they are when the data comes in, because they both would have the same symbol "USTREASURY/YIELD"...
Link Liang
Hi Stefan,
I believe you can find some help here. Please start a new post if you have further questions. Thanks for your support!
Jared Broad
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.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!