From 3f72a0b33fbe51b018f0306d593ce95e80a777fe Mon Sep 17 00:00:00 2001 From: Shane Fontaine Date: Fri, 28 Dec 2018 22:34:13 -0800 Subject: [PATCH] Remove start and end if section is 'hist' --- ethfinex/public_client.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) 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