diff --git a/stock-html/full_signal_scan.py b/stock-html/full_signal_scan.py
index a589721..8beb319 100644
--- a/stock-html/full_signal_scan.py
+++ b/stock-html/full_signal_scan.py
@@ -62,6 +62,7 @@ def get_all_stock_codes(conn):
SELECT code, name FROM stock_realtime_price
WHERE volume > 0 AND price > 0
AND name NOT LIKE '%%退%%'
+ AND name NOT LIKE '%%ST%%'
AND name NOT LIKE 'PT%%'
ORDER BY code
""")
diff --git a/stock-html/routes/analysis.py b/stock-html/routes/analysis.py
index 3b5dc33..bf504c5 100644
--- a/stock-html/routes/analysis.py
+++ b/stock-html/routes/analysis.py
@@ -717,7 +717,8 @@ def get_scan_results():
)
total_scanned = cur.fetchone()[0]
- cur.execute("SELECT count(*) FROM stock_realtime_price")
+ cur.execute("""SELECT count(*) FROM stock_realtime_price
+ WHERE name NOT LIKE '%%退%%' AND name NOT LIKE '%%ST%%' AND name NOT LIKE 'PT%%'""")
total_stocks = cur.fetchone()[0]
where_clauses = ["scan_date = %s"]
@@ -893,6 +894,7 @@ def get_scan_results():
count(*) as cnt
FROM stock_signal_scan, jsonb_array_elements(signal_status) s
WHERE scan_date = %s AND (s.value->>'triggered')::boolean = true
+ AND name NOT LIKE '%%退%%' AND name NOT LIKE '%%ST%%'
GROUP BY s.value->>'name', s.value->>'type'
ORDER BY cnt DESC
""", (scan_date,))
@@ -904,6 +906,7 @@ def get_scan_results():
cur.execute("""
SELECT count(*) FROM stock_signal_scan
WHERE scan_date = %s AND triggered_count > 0
+ AND name NOT LIKE '%%退%%' AND name NOT LIKE '%%ST%%'
""", (scan_date,))
triggered_stocks = cur.fetchone()[0]
@@ -919,6 +922,7 @@ def get_scan_results():
cur.execute("""
SELECT code, signal_status, indicators, triggered_count
FROM stock_signal_scan WHERE scan_date = %s
+ AND name NOT LIKE '%%退%%' AND name NOT LIKE '%%ST%%'
""", (scan_date,))
recommend_counts = {}
for r in cur.fetchall():
@@ -1141,7 +1145,8 @@ def get_scan_status():
)
scanned = cur.fetchone()[0]
- cur.execute("SELECT count(*) FROM stock_realtime_price")
+ cur.execute("""SELECT count(*) FROM stock_realtime_price
+ WHERE name NOT LIKE '%%退%%' AND name NOT LIKE '%%ST%%' AND name NOT LIKE 'PT%%'""")
total = cur.fetchone()[0]
cur.execute(
diff --git a/stock-html/sync_kline.py b/stock-html/sync_kline.py
index 563b004..289863c 100644
--- a/stock-html/sync_kline.py
+++ b/stock-html/sync_kline.py
@@ -60,6 +60,7 @@ def get_all_stock_codes(conn):
SELECT code, name FROM stock_realtime_price
WHERE volume > 0 AND price > 0
AND name NOT LIKE '%%退%%'
+ AND name NOT LIKE '%%ST%%'
AND name NOT LIKE 'PT%%'
ORDER BY code
""")