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.
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'.
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:
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:
http://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...).
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:
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...