diff options
author | sotech117 <michael_foiani@brown.edu> | 2025-09-03 13:54:19 -0400 |
---|---|---|
committer | sotech117 <michael_foiani@brown.edu> | 2025-09-03 13:54:19 -0400 |
commit | ea05658d9868b775fef74fba79a69bd21a43f93d (patch) | |
tree | 6c73e814224b9ea9fa756fb93b5c32c7501b62c1 /api.py | |
parent | 5bf22fc7e3c392c8bd44315ca2d06d7dca7d084e (diff) |
new fft algo with laplacian range of convergencemain
Diffstat (limited to 'api.py')
-rw-r--r-- | api.py | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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 |