From d011771ccd8b3f4e82ce8cf1ec7319e9fa83bfee Mon Sep 17 00:00:00 2001 From: eztam- Date: Fri, 1 Nov 2024 15:00:01 +0100 Subject: [PATCH] Revert "Update AlphaVantage to use the non-premium endpoint to read historical prices" This reverts commit e9e6e0097a7c09d12e4b1d0dbe51600ec3bbcd13. Closes #3605 --- .../portfolio/online/impl/AlphavantageQuoteFeed.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/name.abuchen.portfolio/src/name/abuchen/portfolio/online/impl/AlphavantageQuoteFeed.java b/name.abuchen.portfolio/src/name/abuchen/portfolio/online/impl/AlphavantageQuoteFeed.java index 073b2dbdb4..d95be69ed8 100644 --- a/name.abuchen.portfolio/src/name/abuchen/portfolio/online/impl/AlphavantageQuoteFeed.java +++ b/name.abuchen.portfolio/src/name/abuchen/portfolio/online/impl/AlphavantageQuoteFeed.java @@ -193,7 +193,7 @@ private QuoteFeedData getHistoricalQuotes(Security security, boolean collectRawR { @SuppressWarnings("nls") WebAccess webaccess = new WebAccess("www.alphavantage.co", "/query") // - .addParameter("function", "TIME_SERIES_DAILY_ADJUSTED") // + .addParameter("function", "TIME_SERIES_DAILY") // .addParameter("symbol", security.getTickerSymbol()) // .addParameter("apikey", apiKey) // .addParameter("datatype", "csv") // @@ -208,8 +208,7 @@ private QuoteFeedData getHistoricalQuotes(Security security, boolean collectRawR return data; // poor man's check - if (!"timestamp,open,high,low,close,adjusted_close,volume,dividend_amount,split_coefficient" //$NON-NLS-1$ - .equals(lines[0])) + if (!"timestamp,open,high,low,close,volume".equals(lines[0])) //$NON-NLS-1$ { data.addError(new IOException(MessageFormat.format(Messages.MsgUnexpectedHeader, html))); return data; @@ -222,7 +221,7 @@ private QuoteFeedData getHistoricalQuotes(Security security, boolean collectRawR String line = lines[ii]; String[] values = line.split(","); //$NON-NLS-1$ - if (values.length != 9) + if (values.length != 6) throw new IOException(MessageFormat.format(Messages.MsgUnexpectedValue, line)); LatestSecurityPrice price = new LatestSecurityPrice(); @@ -235,7 +234,7 @@ private QuoteFeedData getHistoricalQuotes(Security security, boolean collectRawR price.setHigh(asPrice(values[2])); price.setLow(asPrice(values[3])); - price.setVolume(Long.parseLong(values[6])); + price.setVolume(Long.parseLong(values[5])); if (price.getValue() != 0) data.addPrice(price);