update share statistics
This commit is contained in:
parent
6be02b5760
commit
622bc8d9a1
@ -85,20 +85,24 @@ async def run():
|
||||
|
||||
cursor = con.cursor()
|
||||
cursor.execute("PRAGMA journal_mode = wal")
|
||||
cursor.execute("SELECT DISTINCT symbol FROM stocks")
|
||||
cursor.execute("SELECT DISTINCT symbol FROM stocks WHERE symbol NOT LIKE '%.%'")
|
||||
stock_symbols = [row[0] for row in cursor.fetchall()]
|
||||
|
||||
counter = 0
|
||||
|
||||
for ticker in tqdm(stock_symbols):
|
||||
try:
|
||||
forward_pe_dict, short_dict = await get_data(ticker, con)
|
||||
if forward_pe_dict.keys() and short_dict.keys():
|
||||
await save_as_json(ticker, forward_pe_dict, short_dict)
|
||||
|
||||
counter += 1
|
||||
if counter % 100 == 0:
|
||||
print(f"Processed {counter} tickers, waiting for 10 seconds...")
|
||||
await asyncio.sleep(10)
|
||||
if counter % 20 == 0:
|
||||
print(f"Processed {counter} tickers, waiting for 5 seconds...")
|
||||
await asyncio.sleep(5)
|
||||
except Exception as e:
|
||||
print(ticker, e)
|
||||
|
||||
|
||||
con.close()
|
||||
|
||||
|
||||
Binary file not shown.
@ -144,7 +144,7 @@ class FundamentalPredictor:
|
||||
|
||||
|
||||
# Second LSTM layer with dropout and batch normalization
|
||||
model.add(LSTM(128, return_sequences=True, kernel_regularizer=regularizers.l2(0.01)))
|
||||
model.add(LSTM(256, return_sequences=True, kernel_regularizer=regularizers.l2(0.01)))
|
||||
model.add(Dropout(0.5))
|
||||
model.add(BatchNormalization())
|
||||
|
||||
@ -153,7 +153,7 @@ class FundamentalPredictor:
|
||||
model.add(Dropout(0.5))
|
||||
model.add(BatchNormalization())
|
||||
|
||||
model.add(Dense(32, activation='relu', kernel_regularizer=regularizers.l2(0.01)))
|
||||
model.add(Dense(64, activation='relu', kernel_regularizer=regularizers.l2(0.01)))
|
||||
model.add(Dropout(0.2))
|
||||
model.add(BatchNormalization())
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user