lavolp3 / MMM-AVStock

MagicMirror module for displaying stock price with yfinance API
MIT License
39 stars 18 forks source link

Adjust the request frequency to have more real-time data #52

Closed YinhaoHe closed 1 year ago

YinhaoHe commented 3 years ago

Hi,

I'm using the newest release version and it feels pretty good. I'm wondering if users are allowed to modify the request frequency to have more real-time basis data(consider that the API request limit is not a problem). Thank you so much.

lavolp3 commented 3 years ago

Hi,

thanks for your interest! Are you using the master branch? The problem with that one is that Alphavantage only updates lots of tickers (e.g. all Nasdaq) only once after market close. That's why I'm working on another API. Beyond that the module is set to the highest possible call frequency for the free tier, which is 5 calls per minute and 500 calls per day.

YinhaoHe commented 3 years ago

Hi, THank you for your reply. Yes, I am using the master branch. I understand the limitation of the API. Would you mind me asking how I can modify the call frequency to a higher level? I have an unlimited API for research. I want to also show the results on a real-time basis using this module. Thank you so much for your help.

lavolp3 commented 3 years ago

https://github.com/lavolp3/MMM-AVStock/blob/9d91d70f5394062216a588336b11db1fbf06d95d/node_helper.js#L91 https://github.com/lavolp3/MMM-AVStock/blob/9d91d70f5394062216a588336b11db1fbf06d95d/node_helper.js#L112

Go to these two lines and change the interval to any value you like in milliseconds.

But as said, for most of the stocks it does not change anything because they are currently updated only once a day by the API itself. Or do you see a different behaviour?

lavolp3 commented 3 years ago

@YinhaoHe Have you found out anything of help? Is it working better now?

lavolp3 commented 1 year ago

Closing due to lack of reply