Yet maybe another reason to end the absurd daylight saving time which does not save anything.


On 02/19/2018 05:02 AM, Justin Smith wrote:
Hi Justin,
I've been chasing this issue for a couple of weeks - I'm pretty sure
this is an ASX specific problem. Unfortunately, I think the problem
lies in the alpha vantage data source - we're going to need to chase
up with them to sort a fix, and may then need an update to
Finance::Quote as well. Alternatively, we need to fix ASX.pm (per my
previous post on this issue).
Here's what I've found to date:
1) Finance::Quote pulls data from alphavantage using an address of the
form:

https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=TLS.AX&apikey=*********************
(You can test this directly with your own api key)
 From the comments in the Perl alphavantage module, this data set
includes date and time data *if* the market is open. Otherwise it only
returns date data only. The perl module removes the time data and
returns the date data.
2) As you have observed (and as can be seen from the above link), the
date returned by alpha vantage for normal ASX stocks is *early* by 1
day - for example, the data set I ran on Sunday 19th returned correct
prices for Monday 12th through Friday 16th, but assigned these to
Sunday 11th through Thursday 15th.
3) I don't believe this can be corrected by timezone shifts - I
suspect that because the alpha vantage module does not return a time,
the perl will (reasonably) assume that the alphavantage data is
returned at mid-night (i.e. if alpha vantage returns 12/2/2018, then
perl/gnucash will treat this as 12/2/2018 00:00 for the purposes of
time zone calcs). If this is the case, it doesn't matter what time
zone shift you apply, it won't change the date.
I ran a set of test on this in gnucash, and couldn't make the date
change no matter what time zone I chose (I'm on East Coast Australian
time).
4) ETFs and possibly managed funds in general are updated later, and
just the at the moment these get the correct date. e.g.

https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=VAS.AX&apikey=*********************
Further notes on this - a) from comments elsewhere on the net, it
looks as though ETFs/managed funds are only updated once per day, and
b) weird things happen to this data on the weekend - e.g. VAS has
correct price information for Friday 16th, but the next available data
point is 4th Feb. This anomaly gets corrected at the start of the week
(don't think this matters for Gnucash use).
5) I'm having the same problem with USD currency rates. Maybe a change
in the API or the constants for AUD/USD. I haven't looked into the
code for this yet.
6) All this may change when daylight saving changes here and/or in the
US - right at the moment, the ASX is closing spot on midnight East
Coast US time (alpha vantage reference time zone) - our data may
suddenly start working correctly when daylight saving changes. So
something else to watch for over the next few weeks.
At this stage, I have only spent time running the problem down - I
haven't had time to think about a fix.
Cheers,
Larry

Thanks Larry. That's great info. After reading your email I did two tests
today (same gnc-fq-dump alphavantage NAB.AX command):

   * Run at 8.00am 19 Feb Perth time (7.00pm 18 Feb New York). ASX open.
     Returns $29.36 with a date of 18 Feb. This price is actually spot on -
assuming a 20min delay on quotes, which most free services quoting the ASX
have. But of course the date is wrong.

   * Run at 6.30pm 19 Feb Perth time (5.30am 19 Feb New York). ASX closed.
     Returns $29.46 with a date of 18 Feb. This is the correct closing
price. But wrong date as expected.

It suggests that simply adding one to the date would fix the issue. But
you're right that we need to test the daylight saving changes. And no doubt
there will different dates in NY and Sydney...

Cheers,
Justin.
_______________________________________________
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

_______________________________________________
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

Reply via email to