Today as I do some back testing, I found there is no close price for the date of July 4th 2017. Here is an example for TSLA.
...
prices = data.history(context.stock, 'price', 20, '1d')
print("%s: %.4f" %(context.stock, prices[-1]))
...
...
2017-07-03 22:30 PRINT Equity(39840 [TSLA]): 367.2860
2017-07-05 22:30 PRINT Equity(39840 [TSLA]): 335.1900
2017-07-06 22:30 PRINT Equity(39840 [TSLA]): 312.4300
2017-07-07 22:30 PRINT Equity(39840 [TSLA]): 314.2600
2017-07-10 22:30 PRINT Equity(39840 [TSLA]): 309.0480
2017-07-11 22:30 PRINT Equity(39840 [TSLA]): 323.4100
2017-07-12 22:30 PRINT Equity(39840 [TSLA]): 329.6000
2017-07-13 22:30 PRINT Equity(39840 [TSLA]): 325.9500
...
I am not if the others have the same problem?