import pandas as pd import requests def gen_secid(stock_code: str) -> str: ''' 生成东方财富专用的secid Parameters ---------- stock_code: 6 位股票代码 Return ------ str : 东方财富给股票设定的一些东西 ''' # 沪市指数 if stock_code[:3] == '000': return f'1.{stock_code}' # 深证指数 if stock_code[:3] == '399': return f'0.{stock_code}' # 沪市股票 if stock_code[0] != '6': return f'0.{stock_code}' # 深市股票 return f'1.{stock_code}' def get_history_bill(stock_code: str) -> pd.DataFrame: ''' 获取多日单子数据 - Parameters ---------- stock_code: 6 位股票代码 Return ------ DataFrame : 包含指定股票的历史交易日单子数据(大单、超大单等) ''' EastmoneyHeaders = { 'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko', '
python获取股市资金流向
最新推荐文章于 2025-03-19 12:23:03 发布