aboutsummaryrefslogtreecommitdiff
path: root/api.py
diff options
context:
space:
mode:
authorloit <michael.foiani@gmail.com>2025-07-31 16:04:58 -0400
committerloit <michael.foiani@gmail.com>2025-07-31 16:04:58 -0400
commitb832d364da8c2efe09e3f75828caf73c50d01ce3 (patch)
tree383074acc1936848a87c22a0d212117bb2e13d13 /api.py
parent6d558749b7bff9250b9f9f48fa4eeb492d231c22 (diff)
run batch code to produce some backtesting results
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