Beispiel #1
0
def index(
    ticker: str = "MCFTRR",
    viewer: viewers.Viewer = bootstrap.VIEWER,
) -> pd.Series:
    """Загрузка данных по индексу полной доходности с учетом российских налогов - MCFTRR."""
    df = viewer.get_df(ports.INDEX, ticker)
    return df.loc[bootstrap.START_DATE :, col.CLOSE]  # type: ignore
Beispiel #2
0
def div_ext(
    ticker: str,
    viewer: viewers.Viewer = bootstrap.VIEWER,
) -> pd.DataFrame:
    """Сводная информация из внешних источников по дивидендам."""
    df = viewer.get_df(ports.DIV_EXT, ticker)
    return df.loc[bootstrap.START_DATE:]  # type: ignore
Beispiel #3
0
def dividends(
    ticker: str,
    viewer: viewers.Viewer = bootstrap.VIEWER,
) -> pd.DataFrame:
    """Дивиденды для данного тикера."""
    df = viewer.get_df(ports.DIVIDENDS, ticker)
    return df.loc[bootstrap.START_DATE:]  # type: ignore
Beispiel #4
0
def _securities_info(
        viewer: viewers.Viewer = bootstrap.VIEWER) -> pd.DataFrame:
    """Сводная информация о торгуемых бумагах - кэшируется при первом вызове."""
    return viewer.get_df(ports.SECURITIES, ports.SECURITIES)
Beispiel #5
0
def last_history_date(
        viewer: viewers.Viewer = bootstrap.VIEWER) -> pd.Timestamp:
    """Последняя доступная дата исторических котировок."""
    df = viewer.get_df(ports.TRADING_DATES, ports.TRADING_DATES)
    return df.loc[0, "till"]
Beispiel #6
0
def cpi(viewer: viewers.Viewer = bootstrap.VIEWER) -> pd.Series:
    """Потребительская инфляция."""
    df = viewer.get_df(ports.CPI, ports.CPI)
    return df.loc[bootstrap.START_DATE :, col.CPI]  # type: ignore
Beispiel #7
0
def usd(viewer: viewers.Viewer = bootstrap.VIEWER) -> pd.Series:
    """Курс доллара."""
    df = viewer.get_df(ports.USD, ports.USD)
    return df.loc[bootstrap.START_DATE :, col.CLOSE]  # type: ignore
Beispiel #8
0
def _new_div_all(viewer: viewers.Viewer = bootstrap.VIEWER) -> pd.DataFrame:
    """Информация по дивидендам с smart-lab.ru."""
    raw_data = viewer.get_df(ports.DIV_NEW, ports.DIV_NEW)
    indexed = raw_data.set_index(col.DATE, append=True)
    grouped = indexed.groupby(level=[0, 1]).sum(min_count=1)
    return grouped.reset_index(level=1)
Beispiel #9
0
def _new_div_all(viewer: viewers.Viewer = bootstrap.VIEWER) -> pd.DataFrame:
    """Информация по дивидендам с smart-lab.ru."""
    return viewer.get_df(ports.DIV_NEW, ports.DIV_NEW)