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
I have derived the script and made it work using sole sheet formulas. The pre/after market values are fetched from this link:
=regexextract(importxml(A1&"TSLA", "/"), "Pre Market Last([^']+)'")
=regexextract(importxml(A1&"TSLA", "/"), "After Market Last([^']+)'")
=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([^']+)'")