auto_trade_sys/check_strange_symbols.py
薇薇安 262ee661a5 1
2026-02-08 09:27:49 +08:00

30 lines
930 B
Python

import sys
import os
from pathlib import Path
# Add project root to path
project_root = Path(__file__).parent
sys.path.insert(0, str(project_root))
from backend.database.models import Trade, TradeRecommendation, get_db_context
def check_strange_symbols():
with get_db_context() as db:
# Check Trades
trades = db.query(Trade).all()
print(f"Checking {len(trades)} trades...")
for t in trades:
if not t.symbol.isascii() or len(t.symbol) > 15:
print(f"Suspicious Trade Symbol: {t.symbol} (ID: {t.id})")
# Check Recommendations
recs = db.query(TradeRecommendation).all()
print(f"Checking {len(recs)} recommendations...")
for r in recs:
if not r.symbol.isascii() or len(r.symbol) > 15:
print(f"Suspicious Rec Symbol: {r.symbol} (ID: {r.id})")
if __name__ == "__main__":
check_strange_symbols()