Skip to content

DataSource Adapters 模块 - API 参考

相关文档

类型文档链接
框架集成Adapters 框架集成framework
架构Adapters 架构文档architecture
设计Adapters 设计文档design
使用指南Adapters 使用指南usage
最佳实践Adapters 最佳实践best-practices

TDX 适配器

TdxStockAdapter

股票数据适配器。

python
from FQData.DataSource.adapters.tdx import TdxStockAdapter

adapter = TdxStockAdapter()

get_security_bars

python
def get_security_bars(
    code: str,
    category: int,
    start: int,
    count: int
) -> pd.DataFrame

获取证券bars数据。

参数:

参数类型说明
codestr证券代码
categoryint周期类型 (0-9)
startint起始位置
countint获取数量

返回: DataFrame


get_security_list

python
def get_security_list(
    market: int,
    start: int = 0
) -> pd.DataFrame

获取证券列表。


TdxIndexAdapter

指数数据适配器。

python
from FQData.DataSource.adapters.tdx import TdxIndexAdapter

adapter = TdxIndexAdapter()

TdxFutureAdapter

期货数据适配器。

python
from FQData.DataSource.adapters.tdx import TdxFutureAdapter

adapter = TdxFutureAdapter()

TdxBondAdapter

债券数据适配器。

python
from FQData.DataSource.adapters.tdx import TdxBondAdapter

adapter = TdxBondAdapter()

TdxRealtimeAdapter

实时行情适配器。

python
from FQData.DataSource.adapters.tdx import TdxRealtimeAdapter

adapter = TdxRealtimeAdapter()

TdxTransactionAdapter

成交明细适配器。

python
from FQData.DataSource.adapters.tdx import TdxTransactionAdapter

adapter = TdxTransactionAdapter()

东方财富适配器

get_stock_fund_flow

python
def get_stock_fund_flow(code: str) -> pd.DataFrame

获取个股资金流向。

参数:

参数类型说明
codestr股票代码

返回: DataFrame

示例:

python
from FQData.DataSource.adapters.eastmoney import get_stock_fund_flow

df = get_stock_fund_flow('600000')

get_stock_analysis

python
def get_stock_analysis(code: str) -> pd.DataFrame

获取股票分析数据。


crawl_eastmoney_fund_flow

python
def crawl_eastmoney_fund_flow(
    start_date: str,
    end_date: str
) -> int

爬取资金流向数据。


同花顺适配器

get_stock_day

python
def get_stock_day(
    code: str,
    start_date: str,
    end_date: str
) -> pd.DataFrame

获取同花顺日线数据。

参数:

参数类型说明
codestr股票代码
start_datestr开始日期
end_datestr结束日期

返回: DataFrame


get_stock_block

python
def get_stock_block(code: str) -> pd.DataFrame

获取股票所属板块。


交易所适配器

get_sh_margin

python
def get_sh_margin(date: str) -> pd.DataFrame

获取上海融资融券数据。

参数:

  • date: 日期 (YYYY-MM-DD)

返回: DataFrame


get_sz_margin

python
def get_sz_margin(date: str) -> pd.DataFrame

获取深圳融资融券数据。


get_margin_all

python
def get_margin_all(start_date: str, end_date: str) -> pd.DataFrame

获取所有融资融券数据。


集思录适配器

create_browser

python
def create_browser() -> webdriver.Chrome

创建 Selenium Chrome 浏览器实例。

返回: Chrome WebDriver


login

python
def login(
    browser: webdriver.Chrome,
    username: str,
    password: str
) -> bool

登录集思录。


get_cbnewlist

python
def get_cbnewlist(browser: webdriver.Chrome) -> pd.DataFrame

获取可转债列表。


常量

东方财富 URL 常量

常量说明
GUGU_ZIJIN_URL个股资金流向 URL
BANKUAI_ZIJIN_URL板块资金流向 URL
GAINIAN_ZIJIN_URL概念资金流向 URL
BANKKuai_GEGu_ZIJIN_URL主力持股资金 URL
GEGU_LISHI_ZIJIN_URL个股历史资金 URL
FENZHONG_ZIJIN_URL分钟资金 URL

相关文档