ezyquant.reader.SETDataReader.get_data_symbol_ytd#

SETDataReader.get_data_symbol_ytd(field: str, symbol_list: List[str] | None = None, start_date: str | None = None, end_date: str | None = None) DataFrame#

Year to date (YTD) refers to the period of time beginning the first day of the current calendar year or fiscal year up to the current date.

Data from table FINANCIAL_STAT_STD and FINANCIAL_SCREEN. If field is in both table, the data from FINANCIAL_STAT_STD will be used.

FINANCIAL_STAT_STD using data from column M_ACC_ACCOUNT multiply 1000. FINANCIAL_SCREEN filter by I_PERIOD_TYPE=’QY’ and I_PERIOD in (‘Q1’,’6M’,’9M’,’YE’).

Index date is trade date (DAILY_STOCK_STAT.D_TRADE). Data is showing at first DAILY_STOCK_STAT.D_TRADE which join on D_AS_OF.

Parameters:
  • field (str) –

    • bad_debt

    • broker_fee

    • change_ppe

    • cos

    • dividend

    • dp

    • ebit

    • ebitda

    • ebt

    • eps

    • int_dvd_income

    • interest_expense

    • interest_income

    • invest_sec_rev

    • loan_deposit_revenue

    • net_cash_flow

    • net_financing

    • net_investing

    • net_operating

    • net_premium

    • net_profit

    • net_profit_incl_minority

    • net_profit_ordinary

    • operating_expense

    • operating_revenue

    • pl_other_activities

    • sale

    • selling_admin

    • selling_admin_exc_renumuration

    • total_expense

    • total_revenue

  • symbol_list (Optional[List[str]] = None) – N_SECURITY in symbol_list, must be unique.

  • start_date (Optional[str] = None) – start of trade date (DAILY_STOCK_STAT.D_TRADE).

  • end_date (Optional[str] = None) – end of trade date (DAILY_STOCK_STAT.D_TRADE).

Returns:

  • symbol(N_SECURITY): str as column

  • trade date(DAILY_STOCK_STAT.D_TRADE): date as index

Return type:

pd.DataFrame

Examples

>>> from ezyquant import SETDataReader
>>> from ezyquant import fields as fld
>>> sdr = SETDataReader()
>>> sdr.get_data_symbol_ytd(
...     field=fld.Q_TOTAL_REVENUE,
...     symbol_list=["COM7", "MALEE"],
...     start_date="2022-02-01",
...     end_date=None,
... )
                   COM7       MALEE
2022-03-01          NaN  3488690.79
2022-03-04  51154660.73         NaN