If Fri or Mon is a holiday, then the OHLC script will produce an error on Mon or Tue bc there is no market data returned during the 3 day buffer. Check if market holiday is in date range and don't produce error.