Trying to import DIV_PAY_DATE but failing

Unfortunatly no idea where I have to look for what I am doing wrong....

I created the following .format file:

# Format definition file generated automatically
# by AmiBroker's ASCII Import Wizard
$FORMAT Date_YMD, Open, High, Low, Close, Volume, Skip, Skip, Skip, Skip, Skip, Skip, DIV_PAY_DATE
$SKIPLINES 1
$SEPARATOR ,
$CONT 1
$GROUP 255
$AUTOADD 1
$DEBUG 1

I edited the one I created for importing my price data. In row 13 there is a date. This date is the expiry date for the futures contract that I want to use for further calculations. I would like to use the DIV_PAY_DATE for this purpose.

Date, Open, High, Low, Close, UnAdjustedClose, Volume, Dividend, Split, TotalVolume, TotalOI, NumericDeliveryMonth, ExpiryDate, ContractSize, PointValue, SpotContract,SpotExpiry,SpotPrice,SpotVol,SpotOI, Cash, CSINumber
2004-03-26,    21.2400,    21.2500,    20.2700,    20.3200,    20.3200,     216,               ,               ,     461,     368,200405,2004-05-19,"$1000 x Index","$0.1",           ,,,,,    17.3300,     919
2004-03-29,    19.9000,    19.9900,    19.7500,    19.8000,    19.8000,      52,               ,               ,     117,     349,200405,2004-05-19,"$1000 x Index","$0.1",           ,,,,,    16.4800,     919
2004-03-30,    19.8600,    20.0400,    19.6100,    19.6200,    19.6200,      93,               ,               ,     191,     448,200405,2004-05-19,"$1000 x Index","$0.1",           ,,,,,    16.2800,     919
2004-03-31,    19.6700,    19.8100,    19.6700,    19.7500,    19.7500,     562,               ,               ,     600,    1007,200405,2004-05-19,"$1000 x Index","$0.1",           ,,,,,    16.7400,     919
2004-04-01,    19.8700,    19.9900,    19.6400,    19.6200,    19.6200,      84,               ,               ,      99,    1044,200405,2004-05-19,"$1000 x Index","$0.1",           ,,,,,    16.6500,     919
2004-04-02,    19.4700,    19.4700,    18.8400,    18.8900,    18.8900,      89,               ,               ,     307,    1297,200405,2004-05-19,"$1000 x Index","$0.1",           ,,,,,    15.6400,     919
2004-04-05,    18.7300,    18.8000,    18.5500,    18.5300,    18.5300,      84,               ,               ,     187,    1276,200405,2004-05-19,"$1000 x Index","$0.1",           ,,,,,    14.9700,     919
2004-04-06,    18.5700,    18.8900,    18.5700,    18.7900,    18.7900,     304,               ,               ,     343,    1828,200405,2004-05-19,"$1000 x Index","$0.1",           ,,,,,    15.3200,     919
2004-04-07,    18.9700,    19.2500,    18.8900,    19.0900,    19.0900,      52,               ,               ,     118,    1828,200405,2004-05-19,"$1000 x Index","$0.1",           ,,,,,    15.7600,     919
2004-04-08,    18.9500,    19.1500,    18.9500,    19.0500,    19.0500,      98,               ,               ,     140,    2009,200405,2004-05-19,"$1000 x Index","$0.1",           ,,,,,    16.2600,     919
2004-04-12,    18.7800,    18.7800,    18.7000,    18.6700,    18.6700,      52,               ,               ,     118,    2132,200405,2004-05-19,"$1000 x Index","$0.1",           ,,,,,    15.2800,     919
2004-04-13,    19.0000,    19.3100,    18.8900,    19.3000,    19.3000,      25,               ,               ,      83,    2232,200405,2004-05-19,"$1000 x Index","$0.1",           ,,,,,    17.2600,     919

That is what my data file looks like.

I would think this should work... but I am under the impression that after the import has worked, I can see this date in the chart window.

Knipsel

Maybe my expectation are wrong, maybe I am doing something wrong. My guess is that something is going wrong and this could be the number of skips I am using (When doing manual import this is limited I think) or it is the date format that is not recognized....

Any help appreciated. tia.

DIV_PAY_DATE is supposed to be a single value not an array of multiple dates.
It is not saved to quote data fields.
It is saved to Information data (visible in information window).
And that value can be retrieved via GetFndata("DividendPayDate")

div_dt = GetFndata("DividendPayDate");
printf( "DividendPayDate: %s", DateTimeToStr(div_dt));

Thanks.

Leaves me with 2 questions:

  1. Is it a problem that I import an "array" of multiple dates ? Hopefully not because I am trying to solve this problem now for half a year and I just can't find a good solution and I hope this will work. (atleast, a solution that I am able to use with my AFL skills :slight_smile: )

  2. It appears even though the data should end up somewhere else, that it is not imported at this moment so there must be something I am doing wrong....

Knipsel

ps: feel free to point me into another solution :slight_smile: I am still trying to figure out how I can use past and present expiration dates and even after the numerous help I received, I have not found a workable solution (for me) yet...

It does import.
But it imports the value of last row of your column that is not empty.
So again not the one of last row of file but last non empty one of column.
If entire column is empty then information field remains empty.

I tried your data and it does import last available date of your sample data.

Add OVERWRITE 1 to your format and see if it works then.

$FORMAT Date_YMD, Open, High, Low, Close, Volume, Skip, Skip, Skip, Skip, Skip, Skip, DIV_PAY_DATE
$SKIPLINES 1
$SEPARATOR ,
$CONT 1
$GROUP 255
$AUTOADD 1
$DEBUG 1
$OVERWRITE 1

Import historical dates to separate ticker (e.g. "YOURTICKER_dates") and use 13th column as date column of that ticker (in your case Date_YMD) and ignore first column's dates (skip). Then you can call that artificial ticker from original one via Foreign functions.

ok. So for now, if it would import, I could atleast try to get my stuff working so I will continue this path :slight_smile: Atleast there are some valuable lessens learned, I am pretty sure it could be done smarter and easier but I just can't :slight_smile:

So since it's not a problem, I will try the div_date

But... the problem is the import... It does not import....

Knipsel

  1. I created my format file. I use a special extension for this file. File is called VX_1.VX_
  2. It's in the correct directory.
  3. I added the $overwrite line but it still does not import.
  4. last day or second last day (and all other day's) do not show anything for dividend pay date

To be as sure as possible that my import was not failing, I deleted the last day using the quote editor and then imported the data again. 28-10 price data was added again, but no div_pay date.

Since it works for you.... I have no clue why it does not on my computer. Date time settings ?

Used the files posted here, used the import wizard and used the lines for the format file during import, that way the import works. After creating new files, the import also works.

So it works. Unfortunatly no idea what went wrong in the first case....

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.