'Loads bars from a trades CSV formatted file.
:param path: The path to the file.
:type path: string.
:param instrument: The instrument identifier.
:type instrument: string.
:param timezone: An optional timezone to use to localize bars. By default bars are loaded in UTC.
:type timezone: A pytz timezone.
:param fromDateTime: An optional datetime to use to filter bars to load.
If supplied only those bars whose datetime is greater than or equal to fromDateTime are loaded.
:type fromDateTime: datetime.datetime.
:param toDateTime: An optional datetime to use to filter bars to load.
If supplied only those bars whose datetime is lower than or equal to toDateTime are loaded.
:type toDateTime: datetime.datetime.
.. note::
* Every file that you load bars from must have trades in the same currency.
* If fromDateTime or toDateTime are naive, they are treated as UTC.'

def addBarsFromCSV(self, path, instrument='BTC', timezone=None, fromDateTime=None, toDateTime=None):

    if (timezone is None):
        timezone = self.__timezone
    rowParser = RowParser(self.__unixTimeFix, timezone)
    prevBarFilter = self.getBarFilter()
    try:
        if (fromDateTime or toDateTime):
            self.setBarFilter(csvfeed.DateRangeFilter(to_utc_if_naive(fromDateTime), to_utc_if_naive(toDateTime)))
        super(CSVTradeFeed, self).addBarsFromCSV(instrument, path, rowParser)
    finally:
        self.setBarFilter(prevBarFilter)
