From b832d364da8c2efe09e3f75828caf73c50d01ce3 Mon Sep 17 00:00:00 2001 From: loit Date: Thu, 31 Jul 2025 16:04:58 -0400 Subject: run batch code to produce some backtesting results --- api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'api.py') 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 -- cgit v1.2.3-70-g09d2