aboutsummaryrefslogtreecommitdiff
path: root/api.py
diff options
context:
space:
mode:
Diffstat (limited to 'api.py')
-rw-r--r--api.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/api.py b/api.py
index 2bc5724..aed31eb 100644
--- a/api.py
+++ b/api.py
@@ -75,10 +75,12 @@ If bad request, returns the previous chart.
"""
def fetch_chart_data_backtest(ticker='XRP/USD', interval='1Min', period_end_date=None, period_length=None):
if period_end_date == None:
- period_end_date = datetime.now().astimezone(pytz.timezone('UTC'))
+ period_end_date = datetime.now()
if period_length == None:
period_length = timedelta(days=5)
+ period_end_date = period_end_date.astimezone(pytz.timezone('UTC'))
+
# cast to int to truncate the decimal
period2 = datetime.isoformat(period_end_date)
# find the first period via subtracting the period length