Click here to Login









How to download the history of dividend payments for stocks in the US market

Updated on 2009-06-18





To create a dividend database, you can get a ready to use download item here History of dividend payments or you can learn how to create one from scratch by following this tutorial.

This tutorial will guide you through the process of creating a download item.
After reading it, you should be able to better understand how to create a download item.

The download item we are about to create will let you create a database for the history of dividend payments for stocks in the US market.

Dividend database

Let us start, first we need to create a new database, so just open the database editor (Data->Edit databases), select 'Creator' tab, then fill in the database name and type, in our case the database name is 'dividend' and the database type is 'End of day'.
Switch to 'Editor' tab, select 'custom' databases then 'dividend' database.
Under the 'Field' panel, type in 'dividend' next to the 'Add new field' button, select 'Double' type from the combo box located above the field where you have typed 'dividend, and finally click on 'Add new field'.

Yahoo website

Go to the yahoo finance website, select a company (GE for example), select 'Historical Prices', check 'Dividend Only', and click on 'Get Prices'.
Now get the URL of the 'Download to Spreadsheet' link; it is something like:
https://ichart.finance.yahoo.com/table.csv?s=GE&a=07&b=19&c=2004&d=05&e=18&f=2009&g=v&ignore=.csv

You should easily notice that for example the 'c' parameter defines the 'Start Date Year' and thus must be changed to [2Y].
Note that [2Y] refers to the 'Start Date Year', while [Y] refers to the 'End Date Year'. Please have a look at the downloader documentation for a description of these symbols.
Now we have to change every date component parameter, the final result looks like this:
https://ichart.finance.yahoo.com/table.csv? a=[2M]&b=[2D]&c=[2Y]&d=[M]&e=[D]&f=[Y]& g=v&ignore=.csv

Note that we have removed the parameter 's' , we will talk about it later, and also note that the month components are offset, which means that 0 is assigned to January, 1 to February (normally 1 is assigned to January...).

Downloader plug-in

Open the downloader plug-in (Download->Download Manager), click on 'Add'.
In the new form, click on 'Add URL', add the URL we specified earlier, click on Fields and add a new field.
Use 's' as field name and 'GE' (General Electric) as value (for testing purpose).
Close this form and select 'CSV Excel' under 'Content Type', finally click on 'Settings'.
We need to update some settings in order for the data to be parsed correctly. We should use:
- Comma as separator
- YMD as date type
We should also add two columns, these columns must use the previously created database, select 'dividend' under 'Database' column.
For the first column set 'Date' under the field column, set 'dividend' for the second column.
Click next twice; there should be no errors. Close the forms and save your download item.
We still have to complete one step, select the previously create download item and click on 'Download'.
In the 'Start & End Dates', click on 'Offset' and set 'Offset Month' to -1.

That's it; you can try it by selecting a list of symbols and clicking on the 'Start' button.

Chart and formula

Here is the chart of the GE dividend history:

Plot history of dividend payments

and here is the formula used to display those dividend payments.

tempData001 = GetData("dividend","dividend",Zero);
plot(tempData001, "dividend", colorRed,ChartLine,StyleOwnScale);

You can use this dividend database to screen for the largest dividend payment, the higher dividend payment increase or to create dividends based trading rules...












one comment (Log in)

QuantShare Blog
QuantShare
Search Posts




QuantShare
Recent Posts

How to Use the Percentage Scale
Posted 299 days ago

QuantShare
Previous Posts

Same chart, different symbols
Posted 3024 days ago

Composite Indicators
Posted 3027 days ago

Example of advanced rule
Posted 3029 days ago

Beta release
Posted 3031 days ago


More Posts

Back







QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright 2017 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
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.