def fetch_ohlcv(self, symbol, timeframe='1m', since=None, limit=None, params={}):
    self.load_markets()
    market = self.market(symbol)
    request = {'book': market['id'], 'time_bucket': self.timeframes[timeframe]}
    if (since is not None):
        request['start'] = since
        if (limit is not None):
            duration = self.parse_timeframe(timeframe)
            request['end'] = self.sum(since, ((duration * limit) * 1000))
    elif (limit is not None):
        now = self.milliseconds()
        request['end'] = now
        request['start'] = (now - ((self.parse_timeframe(timeframe) * 1000) * limit))
    response = self.publicGetOhlc(self.extend(request, params))
    payload = self.safe_value(response, 'payload', [])
    return self.parse_ohlcvs(payload, market, timeframe, since, limit)
def fetch_ohlcv(self, symbol, timeframe='1m', since=None, limit=None, params={}):
    self.load_markets()
    market = self.market(symbol)
    request = {'book': market['id'], 'time_bucket': self.timeframes[timeframe]}
    if (since is not None):
        request['start'] = since
        if (limit is not None):
            duration = self.parse_timeframe(timeframe)
            request['end'] = self.sum(since, ((duration * limit) * 1000))
    elif (limit is not None):
        now = self.milliseconds()
        request['end'] = now
        request['start'] = (now - ((self.parse_timeframe(timeframe) * 1000) * limit))
    response = self.publicGetOhlc(self.extend(request, params))
    payload = self.safe_value(response, 'payload', [])
    return self.parse_ohlcvs(payload, market, timeframe, since, limit)