last day (28 days later) » 

12:07 AM
0
A: Parsing JSON to Excel - LOOP

QHarrJson parser would be an ideal choice. You can however also regex out from the response and handle cases of http errors i.e. where not a successful connection to desired page, as well as and date not found. I read the date from cell A1. The date is formatted unambiguously as yyyy-mm-dd. The ticker...

 
This is working really nice and fast. Thank you!!!:)
This is working perfectly!!:) The code is just reading the dates from a range of cells and extracting the closing price that corresponds to it. Question - I do not have to put anything here correct? p = """DATE_HERE"",""open"":[0-9.]+,""close"":(.*?)," 'Format must be YYYY-MM-DD p = Replace$(p, "DATE_HERE", dateString) In the "Date_HERE" I left like this and code is working. Any wrong syntax?
 
No. Date just needs to be in A1 and tickets from A3 down
 
Your code is super fast, how can I modify to read the current price? just like the code that I posted. Will it work with that speed?
 
Use link above. It now outputs open|close
 
I actually only need the current price from example link before. Date input is not needed: cloud.iexapis.com/stable/stock/AAPL/…
Apologies for going back and forth, but not able to extract the data I need from your code. I need the "latestPrice" let s say from this example (we will have a range of symbols) cloud.iexapis.com/stable/stock/TRNS/…
No I just provided an example of the url. I updated the variable P and this seems to be working, but something is strange. if you take the example below: cloud.iexapis.com/stable/stock/cpl/… The latestprice should be $15.26, but the code is returning $15.52 and cant see this value anywhere in the code. All other symbols are returning the correct value, well except a few with one or three cents difference.
I know - cloud.iexapis.com/stable/stock/cpl/chart/1m?token=token is for historical prices that answered the intial question of this post cloud.iexapis.com/stable/stock/cpl/… is to get the current price (latestprice)
 
12:07 AM
Try this then; pastebin.com/vQiAtk8C
 
Yes this is working, but as I stated there, some results are different then what shoud be returned. For example: CPL returns $15.53 but results should be $15.26 CEQP returns $34.28 but results should be $34.34
 
cpl returns 15.26 to me and the other returns 34.34. Let me add one further line to avoid cached results potentially being served to you.
Try with this modification for caching pastebin.com/wUNPRt9H
 
Yes now this is working perfectly!! However it runs much slower for some reason. Why was I getting wrong data? Do i need to modify the first code that gets the price on a specif date or no?
 
Yeah because the browser is no longer serving cached results but is actually going out, so to speak, to get the data
en.wikipedia.org/wiki/Cache_(computing) - basically it was faster because you were getting data from older requests which were cached.
 
Okay yes I understand - Now things are working well.
Do we need to make any changes for initial code that extract prices on a specific day? Any cached data may affect results? It s historical data will not change anyway :)
 
12:07 AM
I already updated answer.
 
Thank you very much for all your help. Everything is updated and working fine now.
 
Happy days :-) see you on the next question
 

  last day (28 days later) »