How do I retrieve the information about the price of a stock during the after hours, or the pre-market? For example, I can use the formula =googlefinance("TSLA","price") which will retrieve the price of the stock during regular hours. However, it will not show the price during after hours and premarket hours. Thank you
CodePudding user response:
I have derived the script and made it work using sole sheet formulas. The pre/after market values are fetched from this
Note:
- I have separated the link from the ticker for it to be reused to other calls as well, but you can just use it directly like this:
=regexextract(importxml("https://app.quotemedia.com/quotetools/jsVarsQuotes.go?webmasterId=101264&symbol=TSLA", "/"), "Pre Market Last([^'] )'")
and
=regexextract(importxml("https://app.quotemedia.com/quotetools/jsVarsQuotes.go?webmasterId=101264&symbol=TSLA", "/"), "After Market Last([^'] )'")