From bc61f863dafdc6b07d3161abd21e77b193a36202 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Sun, 29 Dec 2024 21:55:00 +0100 Subject: [PATCH] update cron job --- app/cron_dark_pool_level.py | 6 +++--- app/cron_dark_pool_ticker.py | 2 +- app/main.py | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/cron_dark_pool_level.py b/app/cron_dark_pool_level.py index 851a516..749fcbb 100644 --- a/app/cron_dark_pool_level.py +++ b/app/cron_dark_pool_level.py @@ -93,7 +93,7 @@ def run(): cursor = con.cursor() cursor.execute("PRAGMA journal_mode = wal") - cursor.execute("SELECT DISTINCT symbol FROM stocks WHERE marketCap >= 1E9 AND symbol NOT LIKE '%.%'") + cursor.execute("SELECT DISTINCT symbol FROM stocks WHERE symbol NOT LIKE '%.%'") stocks_symbols = [row[0] for row in cursor.fetchall()] etf_cursor = etf_con.cursor() @@ -105,6 +105,7 @@ def run(): etf_con.close() total_symbols = stocks_symbols+ etf_symbols + total_symbols = ['CCLD'] data = [] weekdays = get_last_7_weekdays() for date in weekdays: @@ -114,10 +115,9 @@ def run(): data +=raw_data except: pass - for symbol in tqdm(total_symbols): try: - res_list = [item for item in data if isinstance(item, dict) and item.get('ticker', None) == symbol] + res_list = [item for item in data if isinstance(item, dict) and item['ticker'] == symbol] dark_pool_levels = analyze_dark_pool_levels( trades=res_list, size_threshold=0.8, # Look for levels with volume in top 20% diff --git a/app/cron_dark_pool_ticker.py b/app/cron_dark_pool_ticker.py index 6856456..78c0b05 100644 --- a/app/cron_dark_pool_ticker.py +++ b/app/cron_dark_pool_ticker.py @@ -80,7 +80,7 @@ async def run(): cursor = con.cursor() cursor.execute("PRAGMA journal_mode = wal") - cursor.execute("SELECT DISTINCT symbol FROM stocks WHERE marketCap >= 1E9 AND symbol NOT LIKE '%.%'") + cursor.execute("SELECT DISTINCT symbol FROM stocks WHERE symbol NOT LIKE '%.%'") stocks_symbols = [row[0] for row in cursor.fetchall()] etf_cursor = etf_con.cursor() diff --git a/app/main.py b/app/main.py index 3df00e0..4180086 100755 --- a/app/main.py +++ b/app/main.py @@ -3406,6 +3406,7 @@ async def get_dark_pool(data:TickerData, api_key: str = Security(get_api_key)): except: res = [] + print(res) data = orjson.dumps(res) compressed_data = gzip.compress(data) redis_client.set(cache_key, compressed_data)