AlphaVantage Quote Source

From PalOMoney
Revision as of 14:02, 7 November 2017 by Dev (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

AlphaVantage Quote Source

As of the beginning of November, 2017, the Yahoo Finance APIs used below stopped working. See the blog. Because of this, PalOMoney was updated to version 1.0.8, and MoneyPal was also updated to support the free AlphaVantage service. AlphaVantage.CSV has become the new default quote source, which means that it is first on the list of quote sources, and clicking the Update Now button will simply use this source.

The free Alpha Vantage service requires a free API key that you can immediately obtain from their web site. Anyone can instantly get this API key that works for all sorts of useful security and currency price time series. The quotes are supposedly real-time (not delayed), which is a plus.

Copy and paste 'AlphaVantage.CSV=AlphaVantage.CSV Section' into your PalOMoney.ini file at the [Quote Sources] section as the first line (which makes it the default source) under the section header:

[Quote Sources]
AlphaVantage.CSV=AlphaVantage.CSV Section
Finance.Yahoo.CSV=Finance.Yahoo.CSV Section
...

Then copy the entire section below, paste it into PalOMoney.ini after the above section, and substitute the API key you obtained from AlphaVantage.

[AlphaVantage.CSV Section]
Name=AlphaVantage.CSV
AddOn=(internal)
Output Format=0
Header Schema=1
Schema=
URL Template=
Real Time=1
Historical=1
Multiple Hist=0
Login ID=PutYourAPIKeyHere
Password=

Then you should be good to go. Hit the update now button to test. Retrieving quotes takes longer than Yahoo Finance, and uses more bandwidth, because the AlphaVantage API returns at least 100 dates of data. This is a serious waste of your bandwidth and their processing, and hopefully we can request that they support returning only the most recent quote for single updates, instead of a 100 sample block of historical data.

Also some composite symbols are not supported, e.g., $INDU, $COMPX, $INX, etc. These return the message

   "Error Message": "Invalid API call. Please retry or visit the documentation (https://www.alphavantage.co/documentation/) for TIME_SERIES_DAILY_ADJUSTED."

This also occurs for once valid symbols that are no longer traded, e.g., WCOM, GTW, MCIT, and YHOO, so it seems that you cannot get historical data for these securities.

We are using TIME_SERIES_DAILY_ADJUSTED for latest quotes because it returns the least amount of data. Despite having the 'adjusted_close' amount available, we are not using it. Instead we are updating Money with the 'close' price, and ignoring all the other columns.

The columns are:

   timestamp,open,high,low,close,adjusted_close,volume,dividend_amount,split_coefficient

Perhaps we could update Money with these values, if it would be helpful to anyone. Register and leave a note in the forum.