downloading data from Quandl

Posted By: gtell

downloading data from Quandl - 03/31/20 10:45

Hi, I am using the following script to download data from Quandl:

Code
#include <contract.c>

function run()
{
  StartDate = 2015;
  EndDate = 2018;
  BarPeriod = 1440;
  set(PLOTNOW);
  
  if(is(INITRUN)) {
    assetAdd("DXY");
    int Handle = assetHistory("CHRIS/ICE_DX1",FROM_QUANDL|VOLATILE|OVERRIDE);
    if(Handle) dataSave(Handle,"DXY.t6");
	
  }
  asset("DXY");
  
  string line = strf(
		"%02i/%02i/%02i %02i:%02i, %.5f, %.5f, %.5f, %.5f\n",
		day(),month(),year()%100,hour(),minute(),
		priceOpen(),priceHigh(),priceLow(),priceClose());
  if(is(INITRUN))
		file_delete("Data\\present.csv");
  else
		file_append("Data\\present.csv",line);

  
}


Quandl key is in my ZorroFix.ini file and I am not getting any error.
With curl command I can get data from command line.
With Zorro I am getting a present.csv file which has all lines empty except the last:


Code
13/03/20 15:40, 0.00000, 0.00000, 0.00000, 0.00000
16/03/20 15:40, 0.00000, 0.00000, 0.00000, 0.00000
17/03/20 15:40, 0.00000, 0.00000, 0.00000, 0.00000
18/03/20 15:40, 0.00000, 0.00000, 0.00000, 0.00000
19/03/20 15:40, 0.00000, 0.00000, 0.00000, 0.00000
20/03/20 15:40, 0.00000, 0.00000, 0.00000, 0.00000
23/03/20 15:40, 0.00000, 0.00000, 0.00000, 0.00000
24/03/20 15:40, 0.00000, 0.00000, 0.00000, 0.00000
25/03/20 15:40, 0.00000, 0.00000, 0.00000, 0.00000
26/03/20 15:40, 0.00000, 0.00000, 0.00000, 0.00000
27/03/20 15:40, 0.00000, 0.00000, 0.00000, 0.00000
30/03/20 15:40, 1641.19995, 1652.80005, 1607.19995, 1622.00000



DXY.t6 is not created in History folder.
Do you know what can be the reason?

Thanks.
Posted By: Petra

Re: downloading data from Quandl - 04/02/20 13:07

assetHistory knows CHRIS/ICE but not CHRIS/ICE_DX1. It does not look like valid quandl code. If Quandl has DX1 in the ICE then the correct code would be probably CHRIS/ICE/DX1.
© 2024 lite-C Forums