update cron job

This commit is contained in:
MuslemRahimi 2024-12-29 21:55:00 +01:00
parent 6e94223d3b
commit bc61f863da
3 changed files with 5 additions and 4 deletions

View File

@ -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%

View File

@ -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()

View File

@ -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)