Change ticker interval from minutes as integer to string (1m, 5m, 1h,...)

This commit is contained in:
enenn
2018-03-24 10:21:59 +01:00
parent 616006caf8
commit db46ad6502
21 changed files with 89 additions and 70 deletions

View File

@@ -25,6 +25,7 @@ from freqtrade.arguments import Arguments
from freqtrade.configuration import Configuration
from freqtrade.analyze import Analyze
from freqtrade.logger import Logger
from freqtrade.constants import Constants
import freqtrade.optimize as optimize
import freqtrade.misc as misc
@@ -187,11 +188,12 @@ def plot_profit(args: Namespace) -> None:
plot(fig, filename='freqtrade-profit-plot.html')
def define_index(min_date: int, max_date: int, interval: int) -> int:
def define_index(min_date: int, max_date: int, interval: str) -> int:
"""
Return the index of a specific date
"""
return int((max_date - min_date) / (interval * 60))
interval_minutes = Constants.TICKER_INTERVAL_MINUTES[interval]
return int((max_date - min_date) / (interval_minutes * 60))
def plot_parse_args(args: List[str]) -> Namespace: