Replicate 52-week high trading strategy 
//////////////////////////////////////
George and Huang (2004) show that we could design a profitable trading strategy based on the 52-Week High. First, they          estimate a ratio by   dividing today s price by its 52-week high. Based on such a ratio,  all stocks are sorted from the      highest to the lowest. The stocks belong to the top (bottom) 30% are labeled as winners (losers). Again, 
   the trading strategy is to buy winners and sell losers. They demonstrate that such a trading strategy is 
   quite profitable with an average return  difference of 0.45% per month between the winner and loser portfolios. 

Objectives of this term project:
   1) Understand how to download daily data from Yahoo!Finance [see the versions #1 or #2 below]
   2) Understand how to use R to process data 
   3) Confirm or reject the so-called 52-week High trading strategy 

 Time period: as long as possible        [versions #1 or #2] 
              July 1963 to December 2018 [Version #3] 

 Basic logic: According to George and Huang (2004) it is a profitable trading strategy if we based 
              on the ratio of the current stock price divided by its 52-week High

 Trading strategy: Estimate all stocks  52-week high, estimate the ratio of today s price over its 
     52-week High, sort them from the highest to the lowest. Treat the top 30% as winners and bottom 
     30% as losers. Buy winner and sell losers. 

Procedure for version #1:
  Step 0: formulate your trading strategy: for example, 
             ratio > 0.8 you buy               price - 52wLow
             ratio < 0.3 you sell    ratio = ------------------
                                             (52wHigh - 52wlow)
Procedure for Version #1:
  Step 1: Download one stock from Yahoo!finance [choose max for the time period]
  Step 2: Estimate returns
  Step 3: Sort data from the earliest to the latest
  Step 4: Starting from observation # 253, estimate 52wHigh and 52wLow
  Step 5: Calculate the ratio 
  Step 6: Based on your trading strategy, long or short the stock for the next period
  Step 7: Generate a column for returns for this trading strategy
  Step 8: Test whether this is a profitable trading strategy (benchmark is the long-only trading strategy)

Procedure for versions #2 and #3(CRSP data):
  Step 1: Load data sets stockDaily and stockMonthly
  Step 2: Starting month: July 1963
  Step 3: Estimate  all stocks  52-week High and estimate the ratio Price/52-week high  
  Step 4: Sort all stocks from highest to lowest 
  Step 5: Choose top 30% as winners and bottom 30% as losers
  Step 6: Estimate equal-weighted portfolios return for both winner and looser portfolios
  Step 7: Move to the next month and repeat the above steps until the last month (December 2001)
  Step 8: Conduct a test 
  
     George, Thomas J, and Chuan-Yang Huang, 2004, The 52-week High and Momentum 
           Investing, Journal of Finance 54, 5, 2145-2176.
//////////////////////////////////////