Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update FinnhubQuoteFeed #3669

Merged
merged 1 commit into from Dec 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -92,7 +92,7 @@ private QuoteFeedData getHistoricalQuotes(Security security, boolean collectRawR
try
{
@SuppressWarnings("nls")
WebAccess webaccess = new WebAccess("finnhub.io", "/api/v1/stock/candle")
WebAccess webaccess = new WebAccess("finnhub.io", "/api/v1/quote")
.addParameter("symbol", security.getTickerSymbol()) //
.addParameter("resolution", "D") //
.addParameter("from",
Expand All @@ -117,7 +117,6 @@ private QuoteFeedData getHistoricalQuotes(Security security, boolean collectRawR
JSONArray high = (JSONArray) json.get("h"); //$NON-NLS-1$
JSONArray low = (JSONArray) json.get("l"); //$NON-NLS-1$
JSONArray close = (JSONArray) json.get("c"); //$NON-NLS-1$
JSONArray volume = (JSONArray) json.get("v"); //$NON-NLS-1$

if (timestamps == null)
{
Expand Down Expand Up @@ -148,9 +147,6 @@ private QuoteFeedData getHistoricalQuotes(Security security, boolean collectRawR
Number l = (Number) low.get(index);
price.setLow(l == null ? LatestSecurityPrice.NOT_AVAILABLE : Values.Quote.factorize(l.doubleValue()));

Number v = (Number) volume.get(index);
price.setVolume(v == null ? LatestSecurityPrice.NOT_AVAILABLE : v.longValue());

if (price.getValue() > 0)
data.addPrice(price);
}
Expand Down