跳转至

ETF行情

CurrentMarketMapping

字段映射 ETF/LOF/Stock当前市场行情

CurrentMarket

CurrentMarket(
    market: TypeMarket = "ETF",
    sort_by: Optional[str] = "f3",
    page_size: Optional[int] = 20,
    page_number: Optional[int] = 1,
    verbose: Optional[bool] = False,
    logger: Optional[Callable] = None,
    **kwargs: Any
)

查询 ETF/LOF/Stock当前市场行情

Notes
from wisecon.stock.market import *

# 查询ETF市场当前行情
data = CurrentMarket(market="ETF",).load()
data.to_frame(chinese_column=True)

# 查询LOF市场当前行情
data = CurrentMarket(market="LOF",).load()
data.to_frame(chinese_column=True)

# 查询封闭基金当前行情
data = CurrentMarket(market="封闭基金",).load()
data.to_frame(chinese_column=True)

# 查询沪深京A股当前行情
data = CurrentMarket(market="沪深京A股",).load()
data.to_frame(chinese_column=True)

Parameters:

Name Type Description Default
market TypeMarket

市场类型: [ "沪深京A股", "上证A股", "注册制上证A股", "核准制上证A股", "深证A股", "注册制深证A股", "核准制深证A股", "创业板", "注册制创业板", "核准制创业板", "北证A股", "新股", "科创板", "沪股通", "深股通", "B股", "上证AB股比价", "深证AB股比价", "风险警示板", "风险警示板(SH)", "风险警示板(SZ)", "风险警示板(科创)", "风险警示板(创业)", "两网及退市", "ETF", "LOF", "封闭基金", ]

'ETF'
sort_by Optional[str]

排序字段

'f3'
page_size Optional[int]

每页数据量

20
page_number Optional[int]

页码

1
verbose Optional[bool]

是否打印日志

False
logger Optional[Callable]

自定义日志打印函数

None
**kwargs Any

其他参数

{}
Source code in wisecon\stock\market\market.py
def __init__(
        self,
        market: TypeMarket = "ETF",
        sort_by: Optional[str] = "f3",
        page_size: Optional[int] = 20,
        page_number: Optional[int] = 1,
        verbose: Optional[bool] = False,
        logger: Optional[Callable] = None,
        **kwargs: Any
):
    """
    Notes:
        ```python
        from wisecon.stock.market import *

        # 查询ETF市场当前行情
        data = CurrentMarket(market="ETF",).load()
        data.to_frame(chinese_column=True)

        # 查询LOF市场当前行情
        data = CurrentMarket(market="LOF",).load()
        data.to_frame(chinese_column=True)

        # 查询封闭基金当前行情
        data = CurrentMarket(market="封闭基金",).load()
        data.to_frame(chinese_column=True)

        # 查询沪深京A股当前行情
        data = CurrentMarket(market="沪深京A股",).load()
        data.to_frame(chinese_column=True)
        ```

    Args:
        market: 市场类型: ```
            [
                "沪深京A股",
                "上证A股", "注册制上证A股", "核准制上证A股",
                "深证A股", "注册制深证A股", "核准制深证A股",
                "创业板", "注册制创业板", "核准制创业板",
                "北证A股", "新股", "科创板", "沪股通", "深股通", "B股",
                "上证AB股比价", "深证AB股比价",
                "风险警示板", "风险警示板(SH)", "风险警示板(SZ)", "风险警示板(科创)", "风险警示板(创业)", "两网及退市",
                "ETF", "LOF", "封闭基金",
            ]```
        sort_by: 排序字段
        page_size: 每页数据量
        page_number: 页码
        verbose: 是否打印日志
        logger: 自定义日志打印函数
        **kwargs: 其他参数
    """
    self.market = market
    self.sort_by = sort_by
    self.page_size = page_size
    self.page_number = page_number
    self.mapping = CurrentMarketMapping()
    self.verbose = verbose
    self.logger = logger
    self.kwargs = kwargs
    self.request_set(description="`ETF/LOF/Stock`当前市场行情")

ETFGoldHistoryMapping

字段映射 白银/黄金ETF历史行情

ETFGoldHistory

ETFGoldHistory(
    market: Literal["ETF白银", "ETF黄金"] = "ETF黄金",
    start_date: Optional[str] = None,
    end_date: Optional[str] = None,
    date: Optional[str] = None,
    size: Optional[int] = 100,
    verbose: Optional[bool] = False,
    logger: Optional[Callable] = None,
    **kwargs: Any
)

查询 白银/黄金ETF历史行情

Notes
from wisecon.stock.etf import *

# 1. 查询 ETF白银历史行情
data = ETFGoldHistory(market="ETF白银").load()
data.to_frame(chinese_column=True)

# 2. 查询 ETF黄金某时点
data = ETFGoldHistory(market="ETF黄金", date="2024-10-25").load()
data.to_frame(chinese_column=True)

# 3. 查询 ETF黄金历史行情,并指定查询开始日期
data = ETFGoldHistory(market="ETF黄金", start_date="2024-10-25").load()
data.to_frame(chinese_column=True)

Parameters:

Name Type Description Default
market Literal['ETF白银', 'ETF黄金']

市场类型

'ETF黄金'
start_date Optional[str]

开始日期

None
end_date Optional[str]

结束日期

None
date Optional[str]

查询日期

None
size Optional[int]

返回数据量

100
verbose Optional[bool]

是否打印日志

False
logger Optional[Callable]

自定义日志打印函数

None
**kwargs Any

其他参数

{}
Source code in wisecon\stock\etf\history_gold.py
def __init__(
        self,
        market: Literal["ETF白银", "ETF黄金"] = "ETF黄金",
        start_date: Optional[str] = None,
        end_date: Optional[str] = None,
        date: Optional[str] = None,
        size: Optional[int] = 100,
        verbose: Optional[bool] = False,
        logger: Optional[Callable] = None,
        **kwargs: Any
):
    """
    Notes:
        ```python
        from wisecon.stock.etf import *

        # 1. 查询 ETF白银历史行情
        data = ETFGoldHistory(market="ETF白银").load()
        data.to_frame(chinese_column=True)

        # 2. 查询 ETF黄金某时点
        data = ETFGoldHistory(market="ETF黄金", date="2024-10-25").load()
        data.to_frame(chinese_column=True)

        # 3. 查询 ETF黄金历史行情,并指定查询开始日期
        data = ETFGoldHistory(market="ETF黄金", start_date="2024-10-25").load()
        data.to_frame(chinese_column=True)
        ```

    Args:
        market: 市场类型
        start_date: 开始日期
        end_date: 结束日期
        date: 查询日期
        size: 返回数据量
        verbose: 是否打印日志
        logger: 自定义日志打印函数
        **kwargs: 其他参数
    """
    self.market = market
    self.size = size
    self.start_date = start_date
    self.end_date = end_date
    self.date = date
    self.mapping = ETFGoldHistoryMapping()
    self.verbose = verbose
    self.logger = logger
    self.kwargs = kwargs
    self.request_set(description="白银/黄金ETF历史行情")
    self.conditions = []
    self.validate_date_format(date=[start_date, end_date, date])