From 8a3e41571762e78c97af1dacedb6e7764b4aef44 Mon Sep 17 00:00:00 2001 From: creslin <34645187+creslinux@users.noreply.github.com> Date: Thu, 31 May 2018 19:12:35 +0300 Subject: [PATCH] Update __init__.py --- freqtrade/optimize/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freqtrade/optimize/__init__.py b/freqtrade/optimize/__init__.py index bcab8820e..82acf95f4 100644 --- a/freqtrade/optimize/__init__.py +++ b/freqtrade/optimize/__init__.py @@ -29,7 +29,7 @@ def trim_tickerlist(tickerlist: List[Dict], timerange: Tuple[Tuple, int, int]) - if stype[0] == 'index': start_index = start elif stype[0] == 'date': - while tickerlist[start_index][0] < start * 1000: + while start_index < len(tickerlist) and tickerlist[start_index][0] < start * 1000: start_index += 1 if stype[1] == 'line': @@ -37,7 +37,7 @@ def trim_tickerlist(tickerlist: List[Dict], timerange: Tuple[Tuple, int, int]) - if stype[1] == 'index': stop_index = stop elif stype[1] == 'date': - while tickerlist[stop_index-1][0] > stop * 1000: + while stop_index > 0 and tickerlist[stop_index-1][0] > stop * 1000: stop_index -= 1 if start_index > stop_index: