From b3e57ccbc97230780bcea7bd341b7fb9140acd08 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Sun, 22 Sep 2024 12:52:10 +0200 Subject: [PATCH] add relative ftd rule --- app/cron_info_text.py | 4 ++++ app/primary_cron_job.py | 6 ------ app/restart_json.py | 2 ++ 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/cron_info_text.py b/app/cron_info_text.py index 9c1a261..d1dc007 100644 --- a/app/cron_info_text.py +++ b/app/cron_info_text.py @@ -344,6 +344,10 @@ data = { 'failToDeliver': { 'text': 'Fail to Deliver (FTD) represents the number of shares that were sold but not delivered to the buyer within the standard settlement period. This metric indicates issues in the settlement process and can signal potential liquidity or operational problems in the market.' }, + 'relativeFTD': { + 'text': 'Relative FTD represents the proportion of Fail to Deliver (FTD) shares compared to the average trading volume. It indicates the percentage of undelivered shares in relation to typical volume.', + 'equation': 'Relative FTD = (Fail to Deliver Shares / Avg. Volume) * 100%' + }, 'operatingCashFlowPerShare': { 'text': 'Operating Cash Flow Per Share measures the amount of cash generated from operations per share of stock. It reflects the company’s ability to generate cash from its core business activities relative to the number of shares outstanding.', }, diff --git a/app/primary_cron_job.py b/app/primary_cron_job.py index 0cf9745..734f0ca 100755 --- a/app/primary_cron_job.py +++ b/app/primary_cron_job.py @@ -208,11 +208,6 @@ def run_cron_quote(): run_command(command) -def run_cron_portfolio(): - week = datetime.today().weekday() - if week <= 4: - run_command(["python3", "cron_portfolio.py"]) - def run_cron_options_flow(): week = datetime.today().weekday() current_time = datetime.now().time() @@ -605,7 +600,6 @@ schedule.every(2).days.at("08:30").do(run_threaded, run_financial_score).tag('fi schedule.every().saturday.at("05:00").do(run_threaded, run_ownership_stats).tag('ownership_stats_job') -schedule.every(1).minutes.do(run_threaded, run_cron_portfolio).tag('portfolio_job') schedule.every(5).minutes.do(run_threaded, run_cron_market_movers).tag('market_movers_job') schedule.every(30).minutes.do(run_threaded, run_dividend_list).tag('dividend_list_job') diff --git a/app/restart_json.py b/app/restart_json.py index bce7027..3e81a3d 100755 --- a/app/restart_json.py +++ b/app/restart_json.py @@ -519,8 +519,10 @@ async def get_stock_screener(con): with open(f"json/fail-to-deliver/companies/{symbol}.json", 'r') as file: res = orjson.loads(file.read())[-1] item['failToDeliver'] = res['failToDeliver'] + item['relativeFTD'] = round((item['failToDeliver']/item['avgVolume'] )*100,2) except Exception as e: item['failToDeliver'] = None + item['relativeFTD'] = None try: with open(f"json/ownership-stats/{symbol}.json", 'r') as file: