fix: Correct nested try blocks and indentation in t_sunnyband.py
This commit is contained in:
parent
4984d4944a
commit
819c91ff4a
@ -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")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user