diff --git a/ethfinex/public_client.py b/ethfinex/public_client.py index 0fc1b8c..19b8c1a 100644 --- a/ethfinex/public_client.py +++ b/ethfinex/public_client.py @@ -199,17 +199,19 @@ def get_candles(self, symbol, time_frame, section, ] """ params = {} + # `start` and `end` do not matter if `section='last'` + if section == 'hist': + if start or end and start < end: + if start: + params['start'] = start + if end: + params['end'] = end + elif not start and not end: + pass + else: + raise ValueError('The start time cannot be after the end time.') if limit: params['limit'] = limit - if start or end and start < end: - if start: - params['start'] = start - if end: - params['end'] = end - elif not start and not end: - pass - else: - raise ValueError('The start time cannot be after the end time.') if sort: params['sort'] = sort