I've been away from Quantopian for a few months, so my limited Python skills are rusty. I am trying to identify the number of days since each of these events occurred:
Highest close
Second highest close
Third highest close
Any ideas on how to accomplish this? I asked a similar question and James provided a function that returned the days since a higher high.
Could this be done by making a dictionary of [close_price, days ago] and then sorting by [price]? If so, how to code that?
Thanks for your assistance!