Functions like GOOGLEFINANCE are only updated when the spreadsheet is open by a user, there isn't a Google Apps Script method that is able to do this. The closest is SpreadsheetApp.flush() but this only makes that the changes made by the script be pushed to the spreadsheet.
One alternative is to rethink your model and take advantage that ...
Whenever it refreshes, the data is copied as opposed to new data being
added. It seems like it is adding the formula itself to the
spreadsheet as opposed to putting in the value itself.
If I understand correctly, you want the columns to keep a "snapshot" of the prices at the time the column was added, rather than have the values continue updating.
As the yahoo and google finance API's to use them from google apps script are deprecated, I think the only way to work around it is to generate googlefinance queries from the script as strings and write them in the sheet. Then, once we enter in the sheet those queries are sent.
I don't think this is the most elegant way of do this, and it's also pretty ...
A workaround that solves the above is getting the Close price for the stock for a range of days before and after the date in question, and then querying the result for the most recent price on or before that date, like this:
=QUERY(GOOGLEFINANCE("GOOG","Close",DATEVALUE("1/1/15")-5,6),"select Col2 where Col1 < date '2015-01-02' order by Col1 desc limit 1"...
To further help with this answer. I tried tb11's answer and did not work for me June 2019. It was the URL that was the issue. I picked another site with a simpler URL and it worked for me. Sample below.
Google, if you ...
I used to be able to pull it from google finance, but that stopped working for me a little while back. I found another one. It's not quite as clean, but it is working for me as of March 2019.
In column B, put your ticker symbol
In column C: =IF(NOT(ISBLANK(B12)),GoogleFinance(B12,"Price"),"")
This will populate the current price, which is used in the next ...
=BDMIN(GOOGLEFINANCE("Goog"; "PRICE"; "YourStarDate";"YourEndDate");"CLOSE";
GOOGLEFINANCE("Goog"; "PRICE"; "YourStarDate";"YourEndDate"))
It works for me.
Example for the english locale:
=DMIN(GOOGLEFINANCE("Goog", "PRICE", "10/10/2019","10/11/2019"),"CLOSE",
GOOGLEFINANCE("Goog", "PRICE", "10/10/2019","10/11/2019"))