For the users of my Stock Portfolio Tracker, you might notice that there are some issues getting the end of day Singapore prices.
You would notice a “#NA“, where it says failed to fetch data.
I am puzzled why this happened.
I investigated for 2 days and realize its a combination of:
- How my web host handles the caching of the price file “sp.csv”
- How ImportData function in Google Spreadsheet works
Suffice to say, I was deeply frustrated. So much so it nearly caused me to down the whole Investment Moats and put me out of commission for 2 full days.
Some times price can be retrieved.
Then it stopped working after a while.
Sometimes you get an old cache version of the file.
The Solution
The solution, which might be temporary or alternative, is to use my custom function getSGPrice() instead of ImportData function.
This ...
...