Introduction

The momentum effect is a classic anomaly that says what was strongly going up in the past will probably continue to go up in the near future. The calculation performed uses the rate of change in price movements. We see this effect in REITs through studies where REITs with the highest annual past performance beat lower performing trusts. This strategy will take a long position in companies with the strongest momentum and rebalance quarterly.

Method

The first step is coarse and fine universe selection. During coarse selection, we create an investment universe of stocks that have prices greater than $1, contain fundamental data and do not have a very low trading volume for liquidity purposes. During the fine selection, we take all available REITs by using the Morningstar field IsREIT.

In the fine selection, we also calculate each REIT's past 11-month return one-month lagged and rank them. This is used to determine the top tercile of portfolio.

  1. def coarse_selection_function(self, coarse):
  2. if self.quarterly_rebalance:
  3. self.filtered_coarse = [x.symbol for x in coarse if (float(x.price) > 1)
  4. and (x.has_fundamental_data)
  5. and float(x.volume) > 10000]
  6. return self.filtered_coarse
  7. else:
  8. return []
  9. def fine_selection_function(self, fine):
  10. if self.quarterly_rebalance:
  11. fine = [x for x in fine if (x.company_reference.is_r_e_i_t == 1)]
  12. start = self.time-timedelta(days = 365)
  13. end = self.time-timedelta(days = 30)
  14. for x in fine:
  15. hist = self.history([x.symbol],start,end,Resolution.DAILY)
  16. if not hist.empty:
  17. start_price = hist["close"].iloc[0]
  18. end_price = hist["close"].iloc[-1]
  19. x.momentum = (end_price-start_price)/start_price
  20. fine = [x for x in fine if hasattr(x, 'momentum')]
  21. sorted_filter = sorted(fine, key=lambda x: x.momentum)
  22. self.filtered_fine = [i.symbol for i in sorted_filter]
  23. return self.filtered_fine
  24. else:
  25. return []
+ Expand

In OnData(), we buy the stocks in the best performing tercile for three months and the portfolio is rebalanced every three months by a Scheduled Event.

  1. def on_data(self, data):
  2. if not self.quarterly_rebalance: return
  3. if self.filtered_fine:
  4. portfolio_size = int(len(self.filtered_fine)/3)
  5. long_stocks = self.filtered_fine[-portfolio_size:]
  6. stocks_invested = [x.key for x in self.portfolio]
  7. for i in stocks_invested:
  8. if i not in long_stocks:
  9. self.liquidate(i)
  10. elif i in long_stocks:
  11. self.set_holdings(i, 1/(portfolio_size))
  12. self.quarterly_rebalance = False
  13. self.filtered_fine = False


Reference

  1. Quantpedia - Momentum Effect in REITs

Author

Gurumeher Sawhney

August 2018