Trouble downloading from QUANDL

Posted By: Hredot

Trouble downloading from QUANDL - 06/25/18 14:39

I put the quandl api key into the ini file. My assets file reads as follows:

Quote:
Name,Price,Spread,RollLong,RollShort,PIP,PIPCost,MarginCost,Leverage,LotAmount,Commission,Symbol
NVDA,50,0.1,0,0,0.01,0.01,0,2,1,0.02,QUANDL:NVDA


Now I try to use the following code to download data

Quote:
function run()
{
assetList("History\assets.csv"); // load asset list
while(loop(Assets))
assetHistory(Loop1,FROM_QUANDL);
quit();
}


However, Zorro complains:



And the "history.csv" file shows the following response from QUANDL

Quote:
code,message

QECx05,The url you requested is incorrect. Please use the following url instead: /api/v3/datasets/:database_code/:dataset_code.


What do I do wrong? How can I fix this?
Posted By: Hredot

Re: Trouble downloading from QUANDL - 06/25/18 14:51

Changing just the line

assetHistory(Loop1,FROM_QUANDL);

to

assetHistory(Loop1,FROM_AV);

downloads the data just fine (even though assets.csv still refers to QUANDL). So how to make it work with quandl?
Posted By: AndrewAMD

Re: Trouble downloading from QUANDL - 06/25/18 15:20

Your symbol is QUANDL:NVDA... I thought this notation is for broker arb only, but I could be wrong.

Does it work if you change it to NVDA?
Posted By: Hredot

Re: Trouble downloading from QUANDL - 06/25/18 16:02

@AndrewAMD

Thanks for the suggestion! Changed symbol to NVDA, but the problem still persists in exactly the same fashion.
Posted By: AndrewAMD

Re: Trouble downloading from QUANDL - 06/25/18 17:49

From the manual:

http://zorro-trader.com/manual/en/loadhistory.htm
http://zorro-trader.com/manual/en/data.htm
Quote:
Quandl data from the WIKI (stocks), CHRIS/CME and CHRIS/ICE (futures), BITFINEX and GDAX (Bitcoin and other cryptocurrencies) EOD databases are supported. Other Quandl databases in different formats can be downloaded with the dataDownload function. Quandl data loads fast and is of good quality. The Quandl key must be present in Zorro.ini.
So which Quandl database are you downloading from, exactly?
Posted By: Hredot

Re: Trouble downloading from QUANDL - 06/25/18 18:00

Thank you for pointing this out AndrewAMD!
I would also like to know which one I am trying to download. laugh Literally all the setup that I made is described above. I am not sure where to specify in Zorro which database should be used. Perhaps you know where to look for it?
Posted By: AndrewAMD

Re: Trouble downloading from QUANDL - 06/25/18 18:47

I misspoke. Which database did you **intend** to download from?

I mean - browse Quandl and show us the ticker you want to use. Is the ticker premium or free? Are you paying for premium? Which Quandl database is it under? Will you need to use dataDownload as the manual suggests?
Posted By: Hredot

Re: Trouble downloading from QUANDL - 06/25/18 19:02

Oh, I'm sorry for the confusion. I intend to download from the WIKI, which is freely accessible even without the api (but api key allows for more downloads per time frame).

Here the source I would like Zorro to access:
https://www.quandl.com/api/v3/datasets/WIKI/NVDA/data.csv

See this blog entry for some more details:
https://blog.quandl.com/getting-started-with-the-quandl-api
Posted By: AndrewAMD

Re: Trouble downloading from QUANDL - 06/25/18 21:25

Hmm. Did Quandl change their WIKI dataset formats? (now v3)

You can always do the dataDownload method. Happy parsing! laugh
Posted By: Hredot

Re: Trouble downloading from QUANDL - 06/25/18 21:30

Soo... basically, Zorro is not up to date with current data provider settings. frown
Posted By: AndrewAMD

Re: Trouble downloading from QUANDL - 06/25/18 21:34

No idea. Do you plan on waiting for a fix tomorrow, or will you use dataDownload today?
Posted By: Hredot

Re: Trouble downloading from QUANDL - 06/25/18 21:44

Certainly will try dataDownload today! laugh As soon as I get home.
Posted By: Hredot

Re: Trouble downloading from QUANDL - 06/26/18 00:21

Thank you again for your help AndrewAMD! dataDownload works for getting the data.
However, I just figured out how to get the regular code to work:

Quote:
assetHistory(strf("WIKI/%s",Loop1),FROM_QUANDL);


instead of

Quote:
assetHistory(Loop1,FROM_QUANDL);


does the trick. Would have been nice if this was shown in one of the examples in the manual.
Posted By: AndrewAMD

Re: Trouble downloading from QUANDL - 06/26/18 16:44

This also seems to work:

1) In the Asset list, set Asset to "NVDA" and Symbol to "WIKI/NVDA".
2) Use this script:
Code:
function run()
{
	assetList(".HistoryAssetsWiki.csv"); // load asset list
	while(asset(loop(Assets)))
	assetHistory(Symbol,FROM_QUANDL);
	quit();
}

This way, you can use all kinds of Quandl databases with the same asset list.

But this is odd. I would think that this script should work with this asset list:
Code:
function run()
{
	assetList(".HistoryAssetsWiki.csv"); // load asset list
	while(asset(loop(Assets)))
	assetHistory(0,FROM_QUANDL);
	quit();
}

It does not work. Zorro appears to be checking Quandl for Asset, not Symbol.

jcl, is this expected behavior of AssetHistory when using Quandl?
Posted By: Hredot

Re: Trouble downloading from QUANDL - 06/26/18 23:00

This probably explains why STOOQ download fails as well. If Asset is requested instead of Symbol, then all entries are missing a ".US" at the end (e.g. "NVDA" vs "NVDA.US"). And so naturally STOOQ complains about bad format.
© 2024 lite-C Forums