修正了检查行情出现的各种问题。修正了交易日期的问题,

This commit is contained in:
2026-01-17 23:36:37 +08:00
parent 6e9f6a139a
commit 017bdf2b47
14 changed files with 677 additions and 370 deletions

25
test_fix.py Normal file
View File

@@ -0,0 +1,25 @@
import datetime
import sys
import os
# Add the current directory to the path so we can import the module
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from check_market_data import check_stock_suspended
# Test the function with a recent date
test_date = '20260115' # A date in the recent past
test_ts_code = '000001.SZ' # Test with a known stock
print(f"Testing check_stock_suspended with date: {test_date}")
print(f"Today's date: {datetime.datetime.now().strftime('%Y%m%d')}")
print("-" * 50)
# Call the function
is_suspended, suspend_dates, earliest_suspend_start = check_stock_suspended(test_ts_code, test_date)
print(f"Is suspended: {is_suspended}")
print(f"Suspend dates: {suspend_dates}")
print(f"Earliest suspend start: {earliest_suspend_start}")
print("-" * 50)
print("Test completed successfully!")