From 43ba02afc63e106925b47d3ee9e25a87809f02ae Mon Sep 17 00:00:00 2001 From: creslin <34645187+creslinux@users.noreply.github.com> Date: Sat, 2 Jun 2018 21:59:18 +0300 Subject: [PATCH] Per feed back, kept the stype as date. Use a tuple to keep as epoch int or process via arrow to timestamp. I'll look at the test file also. --- freqtrade/arguments.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/freqtrade/arguments.py b/freqtrade/arguments.py index 00869f974..b61324ccc 100644 --- a/freqtrade/arguments.py +++ b/freqtrade/arguments.py @@ -222,9 +222,9 @@ class Arguments(object): syntax = [(r'^-(\d{8})$', (None, 'date')), (r'^(\d{8})-$', ('date', None)), (r'^(\d{8})-(\d{8})$', ('date', 'date')), - (r'^-(\d{10})$', (None, 'timestamp')), - (r'^(\d{10})-$', ('timestamp', None)), - (r'^(\d{10})-(\d{10})$', ('timestamp', 'timestamp')), + (r'^-(\d{10})$', (None, 'date')), + (r'^(\d{10})-$', ('date', None)), + (r'^(\d{10})-(\d{10})$', ('date', 'date')), (r'^(-\d+)$', (None, 'line')), (r'^(\d+)-$', ('line', None)), (r'^(\d+)-(\d+)$', ('index', 'index'))] @@ -239,18 +239,16 @@ class Arguments(object): if stype[0]: start = rvals[index] if stype[0] == 'date': - start = arrow.get(start, 'YYYYMMDD').timestamp - elif stype[0] == 'timestamp': - start = arrow.get(start).timestamp + start = int(start) if len(start) == 10 \ + else arrow.get(start, 'YYYYMMDD').timestamp else: start = int(start) index += 1 if stype[1]: stop = rvals[index] if stype[1] == 'date': - stop = arrow.get(stop, 'YYYYMMDD').timestamp - elif stype[1] == 'timestamp': - stop = arrow.get(stop).timestamp + stop = int(stop) if len(stop) == 10 \ + else arrow.get(stop, 'YYYYMMDD').timestamp else: stop = int(stop) return stype, start, stop