Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
Remove start and end if section is 'hist'
Browse files Browse the repository at this point in the history
  • Loading branch information
shanefontaine committed Dec 29, 2018
1 parent 6883056 commit 3f72a0b
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions ethfinex/public_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 3f72a0b

Please sign in to comment.