From 819c91ff4a57c8833166e437fef678017c26ff05 Mon Sep 17 00:00:00 2001 From: "Bobby (aider)" Date: Sat, 8 Feb 2025 20:54:51 -0800 Subject: [PATCH] fix: Correct nested try blocks and indentation in t_sunnyband.py --- src/screener/t_sunnyband.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/screener/t_sunnyband.py b/src/screener/t_sunnyband.py index 1c9a931..42a7515 100644 --- a/src/screener/t_sunnyband.py +++ b/src/screener/t_sunnyband.py @@ -58,16 +58,15 @@ def get_valid_tickers(min_price: float, max_price: float, min_volume: int, inter with create_client() as client: # First get valid tickers from daily data daily_query = f""" - SELECT DISTINCT ticker - FROM stock_db.stock_prices_daily - WHERE date = '{yesterday}' - AND close BETWEEN {min_price} AND {max_price} - AND volume >= {min_volume} - ORDER BY ticker ASC - """ - - try: - result = client.query(daily_query) + SELECT DISTINCT ticker + FROM stock_db.stock_prices_daily + WHERE date = '{yesterday}' + AND close BETWEEN {min_price} AND {max_price} + AND volume >= {min_volume} + ORDER BY ticker ASC + """ + + result = client.query(daily_query) tickers = [row[0] for row in result.result_rows] print(f"\nFound {len(tickers)} stocks matching price and volume criteria")