Fix H candle support

This commit is contained in:
Albert De La Fuente Vigliotti
2018-03-16 16:02:40 -03:00
parent 11302b3af9
commit 685ce25b85
3 changed files with 5 additions and 5 deletions
+3
View File
@@ -190,6 +190,9 @@ class CCXT(Exchange):
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
-4
View File
@@ -509,10 +509,6 @@ class Exchange:
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
+2 -1
View File
@@ -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.
@@ -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