update cron job
This commit is contained in:
parent
e56c0eb23e
commit
375a816f74
@ -7,10 +7,6 @@ import os
|
|||||||
import sqlite3
|
import sqlite3
|
||||||
import time
|
import time
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
from concurrent.futures import ThreadPoolExecutor
|
|
||||||
from functools import partial
|
|
||||||
import asyncio
|
|
||||||
import aiohttp
|
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
@ -92,7 +88,8 @@ def get_overview_data():
|
|||||||
total_symbols = stocks_symbols+etf_symbols
|
total_symbols = stocks_symbols+etf_symbols
|
||||||
|
|
||||||
counter = 0
|
counter = 0
|
||||||
total_symbols = ['GME']
|
#Test mode
|
||||||
|
#total_symbols = ['GME','SPY']
|
||||||
for symbol in tqdm(total_symbols):
|
for symbol in tqdm(total_symbols):
|
||||||
try:
|
try:
|
||||||
url = f"https://api.unusualwhales.com/api/stock/{symbol}/greek-exposure"
|
url = f"https://api.unusualwhales.com/api/stock/{symbol}/greek-exposure"
|
||||||
@ -123,7 +120,8 @@ def get_strike_data():
|
|||||||
total_symbols = stocks_symbols+etf_symbols
|
total_symbols = stocks_symbols+etf_symbols
|
||||||
|
|
||||||
counter = 0
|
counter = 0
|
||||||
total_symbols = ['GME']
|
#Test mode
|
||||||
|
#total_symbols = ['GME','SPY']
|
||||||
for symbol in tqdm(total_symbols):
|
for symbol in tqdm(total_symbols):
|
||||||
try:
|
try:
|
||||||
url = f"https://api.unusualwhales.com/api/stock/{symbol}/greek-exposure/strike"
|
url = f"https://api.unusualwhales.com/api/stock/{symbol}/greek-exposure/strike"
|
||||||
@ -152,7 +150,8 @@ def get_expiry_data():
|
|||||||
total_symbols = stocks_symbols+etf_symbols
|
total_symbols = stocks_symbols+etf_symbols
|
||||||
|
|
||||||
counter = 0
|
counter = 0
|
||||||
total_symbols = ['GME']
|
#total_symbols = ['GME','SPY']
|
||||||
|
#total_symbols = ['GME','SPY']
|
||||||
for symbol in tqdm(total_symbols):
|
for symbol in tqdm(total_symbols):
|
||||||
try:
|
try:
|
||||||
url = f"https://api.unusualwhales.com/api/stock/{symbol}/greek-exposure/expiry"
|
url = f"https://api.unusualwhales.com/api/stock/{symbol}/greek-exposure/expiry"
|
||||||
@ -176,6 +175,8 @@ def get_expiry_data():
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
get_overview_data()
|
get_overview_data()
|
||||||
|
time.sleep(60)
|
||||||
get_strike_data()
|
get_strike_data()
|
||||||
|
time.sleep(60)
|
||||||
get_expiry_data()
|
get_expiry_data()
|
||||||
|
|
||||||
|
|||||||
@ -91,6 +91,8 @@ def run_options_jobs():
|
|||||||
now = datetime.now(ny_tz)
|
now = datetime.now(ny_tz)
|
||||||
week = now.weekday()
|
week = now.weekday()
|
||||||
if week <= 5:
|
if week <= 5:
|
||||||
|
run_command(["python3", "cron_options_gex_dex.py"])
|
||||||
|
time.sleep(60)
|
||||||
run_command(["python3", "cron_options_stats.py"])
|
run_command(["python3", "cron_options_stats.py"])
|
||||||
time.sleep(60)
|
time.sleep(60)
|
||||||
run_command(["python3", "cron_options_historical_volume.py"])
|
run_command(["python3", "cron_options_historical_volume.py"])
|
||||||
@ -342,7 +344,7 @@ def run_threaded(job_func):
|
|||||||
|
|
||||||
# Schedule the job to run
|
# Schedule the job to run
|
||||||
|
|
||||||
schedule.every().day.at("03:00").do(run_threaded, run_options_jobs).tag('options_job')
|
schedule.every().day.at("00:00").do(run_threaded, run_options_jobs).tag('options_job')
|
||||||
schedule.every().day.at("01:00").do(run_threaded, run_db_schedule_job)
|
schedule.every().day.at("01:00").do(run_threaded, run_db_schedule_job)
|
||||||
#schedule.every().day.at("05:00").do(run_threaded, run_options_gex).tag('options_gex_job')
|
#schedule.every().day.at("05:00").do(run_threaded, run_options_gex).tag('options_gex_job')
|
||||||
schedule.every().day.at("05:00").do(run_threaded, run_export_price).tag('export_price_job')
|
schedule.every().day.at("05:00").do(run_threaded, run_export_price).tag('export_price_job')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user