def METHOD_NAME(self, start_date, end_date, resolution, to):
    is_backtesting = self.backtesting_time()
    if is_backtesting is not None and end_date is None:
        # is_backtesting can only return a non None value if a function overrides the is_backtesting function
        #  and says its backtesting by returning a valid time
        end_date = is_backtesting
    if start_date is not None and end_date is not None:
        to = None
    to_present = False
    if end_date is None:
        to_present = True
    # convert resolution into epoch seconds
    resolution_seconds = int(time_interval_to_seconds(resolution))
    if end_date is None:
        # Figure out the next point and then subtract to the last stamp
        most_recent_valid_resolution = utils.ceil_date(dt.now(),
                                                       seconds=resolution_seconds).timestamp() - resolution_seconds
        # Binance is nice enough to update OHLCV data, so we have to exclude that by subtracting a resolution
        epoch_stop = most_recent_valid_resolution - resolution_seconds
        count_from = most_recent_valid_resolution
    else:
        if isinstance(end_date, str):
            from dateutil import parser
            parsed_date = parser.parse(end_date)
        elif isinstance(end_date, float) or isinstance(end_date, numpy.int64) or isinstance(end_date, int) or \
                isinstance(end_date, numpy.int32):
            parsed_date = dt.fromtimestamp(end_date)
        else:
            parsed_date = end_date
        valid_time_in_past = utils.ceil_date(parsed_date,
                                             seconds=resolution_seconds).timestamp() - resolution_seconds
        epoch_stop = valid_time_in_past - resolution_seconds
        count_from = valid_time_in_past
    if start_date is None and end_date is None:
        if isinstance(to, int):
            # use number of points to calculate the start epoch
            epoch_start = count_from - (to * resolution_seconds)
        else:
            epoch_start = count_from - time_interval_to_seconds(to)
    elif start_date is None and end_date is not None:
        if isinstance(to, int):
            epoch_start = count_from - (to * resolution_seconds)
        else:
            epoch_start = count_from - time_interval_to_seconds(to)
    else:
        epoch_start = utils.convert_input_to_epoch(start_date)
    return epoch_start, epoch_stop, resolution_seconds, to, to_present