From ea05658d9868b775fef74fba79a69bd21a43f93d Mon Sep 17 00:00:00 2001 From: sotech117 Date: Wed, 3 Sep 2025 13:54:19 -0400 Subject: new fft algo with laplacian range of convergence --- api.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'api.py') diff --git a/api.py b/api.py index 0eba863..df330eb 100644 --- a/api.py +++ b/api.py @@ -150,14 +150,14 @@ def fetch_chart_data_yahoo(ticker='ADA-USD', interval='1m', period_end_date=None if period_end_date == None: period_end_date = datetime.now() if period_length == None: - period_length = timedelta(days=5) + period_length = timedelta(days=8) # cast to int to truncate the decimal period2 = int(datetime.timestamp(period_end_date)) # find the first period via subtracting the period length period1 = int(datetime.timestamp(period_end_date - period_length)) - print(datetime.isoformat(datetime.fromtimestamp(period2)), datetime.isoformat(datetime.fromtimestamp(period1))) + # print(datetime.isoformat(datetime.fromtimestamp(period2)), datetime.isoformat(datetime.fromtimestamp(period1))) params = { 'period1' : period1, # the start date (in epoch time) @@ -170,8 +170,8 @@ def fetch_chart_data_yahoo(ticker='ADA-USD', interval='1m', period_end_date=None headers = {'User-agent' : 'fin-backtesting-proj'} r = requests.get("https://query2.finance.yahoo.com/v8/finance/chart/" + ticker, headers=headers, params=params) - print(r.url) - print("status_code:\t", r.status_code) + # print(r.url) + # print("status_code:\t", r.status_code) # decode the JSON response data into a Python object try: @@ -209,4 +209,4 @@ def fetch_chart_data_yahoo(ticker='ADA-USD', interval='1m', period_end_date=None def test(): fetch_chart_data_backtest() -test() \ No newline at end of file +# test() \ No newline at end of file -- cgit v1.2.3-70-g09d2