1

I can retrieve the exchange rate on a given date with the following command:

=GoogleFinance("audusd","price","09/15/2015")

However if the market is closed that day then GoogleFinance returns "N/A":

=GoogleFinance("audusd","price","11/19/2015")

How do I get GoogleFinance to get me the price even though the market is closed?

Jaap
  • 81,064
  • 34
  • 182
  • 193
BigBrownBear00
  • 1,378
  • 2
  • 14
  • 24

1 Answers1

0

I used the following solution based on the UTC time:

import datetime as dt

nowUTC = dt.datetime.utcnow()                  
    today14= nowUTC.replace(hour=14, minute=25, second=0, microsecond=0)
    today21= nowUTC.replace(hour=21, minute=5, second=0, microsecond=0)

if (nowUTC >= today21 or today14 >= nowUTC):

This solution is based on the times at which the market is closed:

http://www.wisestockbuyer.com/2012/05/what-time-do-stock-markets-open-and-close/

Will AE
  • 11
  • 2