Fix review comments. Add support of datetime timeganges

This commit is contained in:
Anton
2018-04-28 00:16:34 +03:00
parent 2fe7812e20
commit 82ea56c8fd
8 changed files with 194 additions and 60 deletions

View File

@@ -6,6 +6,7 @@ import argparse
import logging
import os
import re
import arrow
from typing import List, Tuple, Optional
from freqtrade import __version__
@@ -228,12 +229,16 @@ class Arguments(object):
stop = None
if stype[0]:
start = rvals[index]
if stype[0] != 'date':
if stype[0] == 'date':
start = arrow.get(start, 'YYYYMMDD').timestamp
else:
start = int(start)
index += 1
if stype[1]:
stop = rvals[index]
if stype[1] != 'date':
if stype[1] == 'date':
stop = arrow.get(stop, 'YYYYMMDD').timestamp
else:
stop = int(stop)
return stype, start, stop
raise Exception('Incorrect syntax for timerange "%s"' % text)