'Loads bars for a given instrument from a CSV formatted file.
The instrument gets registered in the bar feed.
:param instrument: Instrument identifier.
:type instrument: string.
:param path: The path to the CSV file.
:type path: string.
:param timezone: The timezone to use to localize bars. Check :mod:`pyalgotrade.marketsession`.
:type timezone: A pytz timezone.'

def addBarsFromCSV(self, instrument, path, timezone=None):

    if (timezone is None):
        timezone = self.__timezone
    rowParser = GenericRowParser(self.__columnNames, self.__dateTimeFormat, self.getDailyBarTime(), self.getFrequency(), timezone, self.__barClass)
    super(GenericBarFeed, self).addBarsFromCSV(instrument, path, rowParser)
    if rowParser.barsHaveAdjClose():
        self.__haveAdjClose = True
    elif self.__haveAdjClose:
        raise Exception("Previous    bars    had    adjusted    close    and    these    ones    don't    have.")
