Click here to Login

Creating a download item: Initial Jobless Claims

Updated on 2009-11-24

Let us say you want to automate the download process of an economic indicator, you know where you can download the data, you searched for a similar downloader in the QuantShare Sharing server, but unfortunately, you didn't found what you were looking for. Your only choice is to create your own downloader so you can automate the downloading process.

For someone who never used the downloader and haven't read the documentation, it may seem difficult to create a download item. Don't worry, we will create a series of posts introducing each time an example and addressing the main difficulty that someone may find while creating a download item.

For the first post, we are going to show you how to create the following item: Initial Jobless Claims - Historical data.
This downloader retrieves historical data for Initial Jobless Claims. The data is available in the St. Louis Fed website and the URL where the data can be downloaded is:

The download item we want to create will automatically download historical data for the Initial Jobless Claims Series, adds the parsed data into the Quotes database, and associates it with the symbol: ^Initial_Jobless_Claims

Downloading Process
What we notice first is that when we click on the "Download Data" button (in the URL page), a file is downloaded and the URL in the browser does not change. This is because the "Download Data" button sends POST data (Post Data is data sent to the website server without being displayed in the URL).
The first thing we have to do is to detect what parameters this POST data contains. This can be done using the "Detect Post Data" feature of QuantShare.
Create a new download item (Download Manager -> Add), then click on "Detect" (at the bottom).
Add the following URL ( in the URL field then click on "Navigate".
Now select the file format (Text, Comma Separated) then click on the "Download Data" button, the "Detect Post Data" feature of QuantShare will display a popup that includes all the parameters passed to the server by the POST request. Click on "Add URL", and then close the "Detect Post Data" form. The "Update Download Item" form should have a row that contains the previously used URL and the Field button should display "6 Field(s)".

There are three things we need to specify before updating the parser settings:
- Specify that the parameters should be passed with a POST request: Click on "Settings" in the URL row, then check the first checkbox
- Set the content type: In the URL row, double click on the cell under the "Content Type" column and select "CSV_EXCEL".
- Specify the symbol that should be associated with the data (this is because the data doesn't a reference to any symbol): In the URL row, click on the cell under the "Symbol" column and type "^Initial_Jobless_Claims"
- Allow the user to specify the end date: Click on "6 Field(s)" and set the type of the "obs_end_date" row to Custom.

Parsing Process
This is it for the URL settings; now let us do the parsing part. Under the "Parser" column, click on the "Parser" button. The application will download a sample that you can use to make sure that your parser settings are correct.

Here is a subset of the sample:

It is easy to notice that:
The separator is a comma
The date format is YMD
The date separator is "-"
We should add two columns (Quotes-Date and Quotes-Close)
There are 12 lines to skip (You will notice this later)

Now click on "Next", then click on the fields (Quotes -> Date) and (Quotes -> Close) to see how the data was parsed. To validate the parsing, click again on "Next". Make sure there are no errors then click on "Finish".

We hope this post will help you create more downloaders and why not share them later.

3 comments (Log in)

QuantShare Blog
Search Posts

Recent Posts

Create Graphs using the Grid Tool
Posted 1328 days ago

Profile Graphs
Posted 1433 days ago

Previous Posts

How to search for a download item
Posted 5362 days ago

Trading orders - Part 2
Posted 5369 days ago

Trading Orders - Part 1
Posted 5376 days ago

Sharpe Ratio - Part 2
Posted 5397 days ago

Sharpe Ratio - Part 1
Posted 5403 days ago

The 'inside period' function
Posted 5417 days ago

Quantshare version 1.4
Posted 5431 days ago

More Posts


Create an account
Affiliate Program
Contact Us
Trading Forum
How-to Lessons
About Us
Terms of Use

Copyright 2024
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Follow us on Google+
RSS Trading Items

Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.