Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Calculate 52 week highs on ratio US Equities/SPY using CustomFactors

Hi,

This is my first post on Quantopian! As recommended, I started with Research, trying to create CustomFactors. I would need help, please. Below a quick description of what I would like to do:

  1. Calculate for each day the ratio between the latest price of all US equities and SPY. I am OK on this part (see notebook attached, factor ratio_SPY)
  2. Identify the highest level of the ratio over the last 252 days. I was able to do it with absolute prices '(see factor High52W) but I don't know how to use the ratio created with ratio_SPY as "price" input in customFactor High52W.

Any comment would be much appreciated and I hope will also help other members.

Thanks