get rid of TICKER_INTERVAL_MINUTES dict, use ccxt's parse_timeframe() instead

This commit is contained in:
hroff-1902
2019-04-04 20:56:40 +03:00
parent 75c522e082
commit 2aa1b43f01
11 changed files with 52 additions and 42 deletions

View File

@@ -28,6 +28,7 @@ from freqtrade import constants, misc
from freqtrade.arguments import Arguments
from freqtrade.configuration import Configuration
from freqtrade.data import history
from freqtrade.misc import timeframe_to_seconds
from freqtrade.resolvers import StrategyResolver
from freqtrade.state import RunMode
@@ -193,8 +194,8 @@ def define_index(min_date: int, max_date: int, interval: str) -> int:
"""
Return the index of a specific date
"""
interval_minutes = constants.TICKER_INTERVAL_MINUTES[interval]
return int((max_date - min_date) / (interval_minutes * 60))
interval_seconds = timeframe_to_seconds(interval)
return int((max_date - min_date) / interval_seconds)
def plot_parse_args(args: List[str]) -> Namespace: