ezyquant.reader.SETDataReader.get_dividend#
- SETDataReader.get_dividend(symbol_list: List[str] | None = None, start_date: str | None = None, end_date: str | None = None, ca_type_list: List[str] | None = None, adjusted_list: List[str] = ['', 'CR', 'PC', 'RC', 'SD', 'XR']) DataFrame #
Data from table RIGHTS_BENEFIT. Include only Cash Dividend (CD) and Stock Dividend (SD). Not include Cancelled (F_CANCEL!=’C’) and dps more than 0 (Z_RIGHTS>0). ex_date and pay_date can be null.
- Parameters:
symbol_list (Optional[List[str]] = None) – N_SECURITY in symbol_list (must be unique).
start_date (Optional[str] = None) – start of ex_date (D_SIGN).
end_date (Optional[str] = None) – end of ex_date (D_SIGN).
ca_type_list (Optional[List[str]] = None) –
- Corporate action type (N_CA_TYPE).
CD - cash dividend
SD - stock dividend
adjusted_list (List[str] = ["", "CR", "PC", "RC", "SD", "XR"]) – Adjust data by ca_type (empty list for no adjustment).
- Returns:
- dividend dataframe contain columns:
symbol: str - SECURITY.N_SECURITY
ex_date: date - D_SIGN
pay_date: date - D_BEG_PAID
ca_type: str - N_CA_TYPE
dps: int - Z_RIGHTS
- Return type:
pd.DataFrame
Notes
ex_date and pay_date can be null.
pay_date can be non trade date.
Examples
>>> from ezyquant import SETDataReader >>> sdr = SETDataReader() >>> sdr.get_dividend(["M"]) symbol ex_date pay_date ca_type dps 0 M 2014-05-06 2014-05-21 CD 1.6 1 M 2014-08-20 2014-09-04 CD 0.8 2 M 2015-04-30 2015-05-21 CD 1.0 3 M 2015-08-24 2015-09-08 CD 0.9 4 M 2016-04-28 2016-05-19 CD 1.0 5 M 2016-08-23 2016-09-08 CD 1.0 6 M 2017-05-04 2017-05-23 CD 1.1 7 M 2017-08-22 2017-09-08 CD 1.1 8 M 2018-05-07 2018-05-23 CD 1.2 9 M 2018-08-22 2018-09-07 CD 1.2 10 M 2019-05-07 2019-05-23 CD 1.3 11 M 2019-08-26 2019-09-11 CD 1.3 12 M 2020-04-22 2020-05-08 CD 1.3 13 M 2020-08-24 2020-09-10 CD 0.5 14 M 2021-05-10 2021-05-25 CD 0.5 15 M 2022-05-10 2022-05-25 CD 0.8 >>> sdr.get_dividend(["M"], start_date="2020-07-28", end_date="2022-05-11") symbol ex_date pay_date ca_type dps 0 M 2020-08-24 2020-09-10 CD 0.5 1 M 2021-05-10 2021-05-25 CD 0.5 2 M 2022-05-10 2022-05-25 CD 0.8