R
RickAns
Guest
Just to be certain I believe we are talking about wtf_dude's code. It does make sense that the hi / lo numbers are the same. The look back period is a year, then the quarters are ranked against each other. With more concern given to the most recent quarter.
I am still new to coding so it took me to read it a few times to make sense. It does, but I may not be the best one to explain it to someone else. This uses a one year time frame 252 trading days that's a given. What we are setting (I believe) with day / week / month is just a small window or snapshot of what the data ranking is for the current most recent day/ week/ etc. Try not to think of it as setting (for example) a time period of a moving average or whatever.
I can delete my example if completely wrong in order to avoid further confusion.
Added:
By changing the hi /lo to 21 in your example post instead of the original 252 you have told the code to look back only 21 days max instead of a year. Preventing you from getting the stock's high and low of the year. So you are only getting a ranking for the last month's worth of data.
Does this help?
I am still new to coding so it took me to read it a few times to make sense. It does, but I may not be the best one to explain it to someone else. This uses a one year time frame 252 trading days that's a given. What we are setting (I believe) with day / week / month is just a small window or snapshot of what the data ranking is for the current most recent day/ week/ etc. Try not to think of it as setting (for example) a time period of a moving average or whatever.
I can delete my example if completely wrong in order to avoid further confusion.
Added:
By changing the hi /lo to 21 in your example post instead of the original 252 you have told the code to look back only 21 days max instead of a year. Preventing you from getting the stock's high and low of the year. So you are only getting a ranking for the last month's worth of data.
Does this help?
Last edited by a moderator: