03-16-2015 12:20 PM
suppose I have the following data of stocks and their prices for different dates:
What I would like to have is the for each stock its highest price and the date date when it happened (more precisely, the entire corresponding row):
03-16-2015 01:04 PM
thanks for the code, its actually quite simple and I probably should have been able to figure it out, but when posing the question I had in mind calculating the max as part of a bigger code.
And what a lucky coincidence!!!
Yesterday you answered my question about lagged returns with the following code:
if not first.sector then return = (price - k) / k;
On the same discussion, I was already given an answer for calculating the return between any 2 periods, and wanted to add to it the max price (and its date) between these 2 periods, and that's why I asked the present question.
I guess that now I can just merge max price and date table of your code with the return for each stock bw 2 periods.
Need further help from the community? Please ask a new question.