Skip to content

Commit

Permalink
Merge branch 'vonpupp-fix_hourly_candles' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
fredfortier committed Mar 16, 2018
2 parents 0d77854 + decbdbf commit b76b445
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 3 additions & 0 deletions catalyst/exchange/ccxt/ccxt_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ def get_candle_frequencies(self, data_frequency=None):
if data_frequency == 'minute' and not freq.endswith('T'):
continue

elif data_frequency == 'hourly' and not freq.endswith('D'):
continue

elif data_frequency == 'daily' and not freq.endswith('D'):
continue

Expand Down
4 changes: 0 additions & 4 deletions catalyst/exchange/exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,10 +509,6 @@ def get_history_window(self,
frequency, data_frequency, supported_freqs=['T', 'D', 'H']
)

if unit == 'H':
raise InvalidHistoryFrequencyAlias(
freq=frequency)

# we want to avoid receiving empty candles
# so we request more than needed
# TODO: consider defining a const per asset
Expand Down
3 changes: 2 additions & 1 deletion catalyst/exchange/utils/datetime_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def get_year_start_end(dt, first_day=None, last_day=None):
return year_start, year_end


def get_frequency(freq, data_frequency=None, supported_freqs=['D', 'T']):
def get_frequency(freq, data_frequency=None, supported_freqs=['D', 'H', 'T']):
"""
Get the frequency parameters.
Expand Down Expand Up @@ -309,6 +309,7 @@ def get_frequency(freq, data_frequency=None, supported_freqs=['D', 'T']):
if 'H' in supported_freqs:
unit = 'H'
alias = '{}H'.format(candle_size)
data_frequency = 'hourly'

else:
candle_size = candle_size * 60
Expand Down

0 comments on commit b76b445

Please sign in to comment.