The following table consists of Price Returns returns at different Dates:
Idea: For any given Date and Stock Ticker, if returns data of previous 12 time steps is available (cell is not NaN), sum those returns and stock them in a new table. Code:
% Take row by row
% Considering columns 2 to 279 look at each date point if returns data for previous 12 time steps (weeks) is available
for i=length(Tnew.Date) for j=TNew.x1COVGY:end if (TNew.x1COVGY:end = ~(‘NaN’)) % Sum those 12 entries and list the result in a new table. For example, A2AIM's value for 30-Oct will be the sum of values between 30-Oct and 14-Aug.
endend
Thanks for your help!!
Best Answer