Hello Mohamed, The data is too big, so I will not upload it, but it looks like this: time stockid return 200501 123 0.55 200502 123 -0.01 200501 234 0.09 200502 234 0.08 So it is a panel data, with around 500 stocks' monthly return in around 10 year's time. And the time format in the raw data is year together with month. The assignment is to create and test two investing strategies based on momentum and volatility. Momentum will be the return of a stock of the past 12 month minus the past 1 month. So for example, the momentum for stock 123 in 200501 will be its cumulative return during 200401-200412. The proxy for volatility will be the variance, which is calculated based on the past 3 years. For example again, the volatility for stock 123 in 200501 will be calculated using the returns from 200201-200412. Firstly I need to construct the two measures in my data set, then I need to follow the first two steps in the link (winsorize, single sorting). The macros are already there, but I do not know how to connect them... I would appreciate your help very much!
... View more