修正了检查行情出现的各种问题。修正了交易日期的问题,
This commit is contained in:
25
test_fix.py
Normal file
25
test_fix.py
Normal 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!")
|
||||
Reference in New Issue
Block a user