Welcome to Quantapi!

HKEX Dividends Algo

Date: 2018-10-11
Author: Nick Wong

This algo helps me to pick stocks to trade before their dividends ex-date. I want to make it automatically update and put it online for self reference.

Here are my algorithms to choose stocks to buy from this algo:
1. Grab the dividends news from aastocks.
2. Grab the last day close price of the stocks in list 1.
3. Grab the market cap. of the stocsk in list 1.
4. Calculate the dividends rates of the stocks with this formulae = dividends / close price.
5. Calculate the remaining days to ex-date from current day.
6. Filter out stocks which is:
  • a. market cap smaller than 5 billions (50億) to reduce risks.
  • b. dividends rates greater or equal to 3%.
  • c. remaining days to ex-date is greater or equal to 14 days.
7. Normally I will pick 3 or 4 stocks to buy and hold before ex-date to sell. DO NOT hold till ex-date as the stock price will drop on ex-date to reflect the dividends deductions.

ex-date code name dividends announced date pay date book close date market cap close price dividends rate days to ex