Closed shevett closed 6 months ago
Unfortunately AlphaVantage only provides the last days closing price in their API for a few weeks/months now. So what you see is yesterdays closing price. It will not change until todays close.
THere's nothing wrong with the module.
Note the update date is current, but the values are hours old.
The "update time" value is not very useful currently. It shows the last time the API has been successfully tapped.
Well that will explain it :). Is there another source I can use to get relatively current values?
I'm working on using the IEX Cloud API. I need to change the base code. You can't do much yet apart from completely rewriting node_helper.js.
@shevett would you like to do some beta testing for me?
I have pushed a new branch new_api
including the IEX API. You would need an IEX API key (as described in the README) in ADDITION to the alphavantage key.
Then you will have up-to-date quotes in table, ticker, and grid.
Unfortunately I cannot switch completely to IEX, since fetching historical data is too expensive and would blow the free quota limit.
git fetch
git checkout new_api
git pull
Let me know if you can and want to test it.
Or hold a moment. I think I have found a more appropriate API. Twelve Data looks good. Just give me a few more days. You can still try to use this. But I may not use IEX in the end
I"ll wait til you give me the high sign and i'll try it out.
Hi Dirk @lavolp3,
I like to test with you, if you have implemented the new API.
one more hint: I mean onvista.com also has an API and as far as I remember it was completely free. However, I can't find anything about it right now. Maybe this will help you.
As far as I can see, onvista provides the API to get access to your own account (balance, transactions), not to stock data. comdirect does the same.
@spitzlbergerj it has taken some time :-D but I have now included the yahoo finance API. If you're still interest I am happy if you can update and check. There's no api key needed.
Hi @lavolp3, Thank you for taking care of the matter. I have used another ticker in the meantime, but will gladly return to your ticker. Please give me some time to test it, I have too many "projects" running in parallel. Thanks again!
Hi @lavolp3, sorry that it took a while, but yesterday I was able to update and try. Unfortunately, the display does not work for me yet. I didn't have much time unfortunately. I have only seen two error messages that I could not follow up yet:
MMM-AVStock.js:387
Uncaught (in promise) TypeError: Cannot set properties of null (setting 'innerHTML')
at Class.updateData (MMM-AVStock.js:387:34)
at Class.socketNotificationReceived (MMM-AVStock.js:408:18)
at module.js:234:9
at Socket.
[06.10.2023 09:01.30.586] [ERROR] (node:2641) UnhandledPromiseRejectionWarning: FetchError: request to https://query2.finance.yahoo.com/v10/finance/quoteSummary/TL0.F?formatted=false&modules=price&crumb=warpfd.R.6X failed, reason: getaddrinfo EAI_AGAIN query2.finance.yahoo.com
at ClientRequest.--unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2111)
Thanks @spitzlbergerj Looks like an error thrown by the API because it couldn't find the ticker. These should be catched so the module doesn't break. I will follow this up.
Have pushed an update. Now a ticker that could not be found throws an error in the console (provided by node-helper), but does not crash the module anymore. The entry in the table is then empty.
Good morning @lavolp3 , Unfortunately it still does not work after the update. This is my config
{
module: "MMM-AVStock",
position: "bottom_bar",
config: {
/* apiKey : "0TS4Z1L0W4YC3H84", /* josef@spitzlberger.de */
/* apiKey : "KB3ODR6LWJ5QX71D", /* paula@kleeberger.de */
mode : "ticker",
symbols : [ "TL0.F", "RIVN", "MSF.DE", "PRG.DE", "EUNL.F", "AMEW.DE"],
alias: [ "Tesla", "Rivian", "Microsoft", "Proc&Gam", "MSCI i", "MSCI a"],
purchasePrice: [ 76.77, 23.20, 131.05, 96.15, 70.30, 262.75],
purchaseQuantity: [217, 260, 10, 20, 471, 46],
decimals: 0,
tickerDuration: 20,
showChart: false,
showVolume: false,
showPurchasePrices: true,
showPerformance2Purchase: true,
showStockValueTotal: true,
debug: false,
}
},
and these are the errors that appear now
Uncaught (in promise) TypeError: Cannot set properties of null (setting 'innerHTML')
at Class.updateData (MMM-AVStock.js:387:34)
at Class.socketNotificationReceived (MMM-AVStock.js:408:18)
at module.js:234:9
at Socket.<anonymous> (socketclient.js:38:4)
at Emitter.emit (index.mjs:136:20)
at Socket.emitEvent (socket.js:498:20)
at Socket.onevent (socket.js:485:18)
at MMSocket.socket.onevent (socketclient.js:32:11)
at Socket.onpacket (socket.js:455:22)
at Emitter.emit (index.mjs:136:20)
Uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'quotes')
at Class.socketNotificationReceived (MMM-AVStock.js:406:43)
at module.js:234:9
at Socket.<anonymous> (socketclient.js:38:4)
at Emitter.emit (index.mjs:136:20)
at Socket.emitEvent (socket.js:498:20)
at Socket.onevent (socket.js:485:18)
at MMSocket.socket.onevent (socketclient.js:32:11)
at Socket.onpacket (socket.js:455:22)
at Emitter.emit (index.mjs:136:20)
at manager.js:204:18
Thanks for your time
Ok that seems to be related to the ticker, I haven't looked at that during the recent update. Will check over the coming days
to update here, the ticker currently works for me. So I'll close this one. @spitzlbergerj maybe you find he time to try again.
Good morning. I've been runing AVstock on my displayboard for several months. Right now I'm noticing that when I come in in the morning, the value is accurate for market opening, but will not update for the rest of the day, even thoush 'last quote' is showing the current value. Screenshot (via phone, sorry)
Note the update date is current, but the values are hours old.
Here's my config:
Most recent pull was the last time i tried to fix this, a few weeks ago: