BookmarkSubscribeRSS Feed
ZZB
Obsidian | Level 7 ZZB
Obsidian | Level 7

Hi all,

I'm replicating JT's (2001, JF) 'momentum' strategy and meet a problem about how to exclude stocks with price less than 5. Because this strategy is monthly rebalaced, the problem seems much more complicated than that if portfolio is nonoverlapping. I attached the paper (See P702-703)

There are N stocks in a dataset. For example, stock A's price is 6 at time t, 4 at t+1, 5.5 at t+2, 4.8 at t+3 ...

Time              Stock                     Price                   Return

1985/01            A                           6                        given

1985/02            A                           4                       

1985/03            A                           5.5                      

1985/04            A                           4.8                    

1985/01            B                           6.2                           

1985/02            B                           5.1                      

1985/03            B                           4.8                  

1985/04            B                           6                       

1985/01            C                           23                 

1985/02            C                           19                   

1985/03            C                           20                       

1985/04            C                           22                   

........

I know how to calculate the avearge monthly returns rebalanced monthly if no more condition is required. However, now we want to exclude all stocks priced below $5 at the begining of holding period (e.g., when the begining of the holding period is 1985/01, stock A,B,C's prices are above 5, so they are included in portfolio; for 1985/02, only stock B and C are in portfolio, for 1985/03, A and C, and so on). If the holding period is 3 months, for 1985/04, the rebalanced average monthly return is  1/3(1985/04-02)+1/3(1985/03-1985/01)+1/3(1985/02-1984/12).

If we just use codes 'if price<=5 then delete' at the begining, the result is different from JT(2001), though I got the similar result when I replicate JT (1993) without such price condition. How to construct such monthly rebalanced dataset if condition about price is added?

Thanks

2 REPLIES 2
TarunKumar
Pyrite | Level 9

data test;

input Time:$7.    Stock:$1.                     Price               ;

datalines;

1985/01            A                           6                  

1985/02            A                           4                      

1985/03            A                           5.5                     

1985/04            A                           4.8                   

1985/01            B                           6.2                          

1985/02            B                           5.1                     

1985/03            B                           4.8                 

1985/04            B                           6                      

1985/01            C                           23                

1985/02            C                           19                  

1985/03            C                           20                      

1985/04            C                           22                  

;

run;

proc sql;

create table want as

select * from test

where stock not in (select distinct stock from test

where price <= 5);

quit;

trest_luam
Calcite | Level 5
Hello ZZB;
Have you ever solved this problem?
I am facing the same issue. Could you help? please?
Thanks

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2462 views
  • 0 likes
  • 3 in conversation