Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to calculate Jagadeesh and Titman (1993) momentum strategies in STATA

    I am a PhD student and working on JT(1993) momentum strategies. I am looking for a code in STATA to calculate these strategies.

    Can anyone help me please.

    Regards

  • #2
    Please read and follow https://www.statalist.org/forums/help including #13 on references. Did you Google or search in Stata given your author names?

    Comment


    • #3
      Originally posted by Nick Cox View Post
      Please read and follow https://www.statalist.org/forums/help including #13 on references. Did you Google or search in Stata given your author names?
      Sorry I did not clearly understand you. I have been googling for quite sometime "how to calculate momentum strategies in STATA"? I got few codes but still there are some confusion left. I need somebody's help that could just briefly explain the methodology in steps.

      I will highly grateful.

      Comment


      • #4
        Let me try to elaborate Nick's comment. First, follow the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex. if you want to refer to a paper, give us a proper reference, not just authors and year. Assume we are not from your area of study and may be unwilling to read a paper just to help you. So if you want us to help you calculate something, you'll need to tell us what you want to calculate (and your initial efforts at the calculation).

        Googling got me to
        http://www.opendoors.pk/home/paid-so...olios-strategy
        .

        Comment


        • #5
          Originally posted by Phil Bromiley View Post
          Let me try to elaborate Nick's comment. First, follow the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex. if you want to refer to a paper, give us a proper reference, not just authors and year. Assume we are not from your area of study and may be unwilling to read a paper just to help you. So if you want us to help you calculate something, you'll need to tell us what you want to calculate (and your initial efforts at the calculation).

          Googling got me to
          http://www.opendoors.pk/home/paid-so...olios-strategy
          .
          Dear Phil, I have the following code for J6K6 strategy. Can you please help me to find out any mistake in my code. I just want a comment. When I try to do it on Excel, I am lost while doing loser portfolio.

          gen mdate = date(date, "DM20Y")

          format mdate %tm

          xtset code mdate

          bysort code: gen returns = 100*((prices[_n]-prices[_n-1])/prices[_n-1])

          bysort code: gen ret_of_past = returns[_n-1]+ returns[_n-2]+ returns[_n-3]+ returns[_n-4]+ returns[_n-5]+ returns[_n-6]

          bysort code: gen ret_of_future = returns[_n+1]+ returns[_n+2]+ returns[_n+3]+ returns[_n+4]+ returns[_n+5]+ returns[_n+6]

          xtile r6p = ret_of_past, nq(10)

          xtile r6f = ret_of_future, nq(10)

          bysort mdate: gen W = r6f if r6p == 10

          bysort mdate: gen L = r6f if r6p == 1

          bysort mdate: egen meanW = mean(W)

          bysort mdate: egen meanL = mean(L)

          gen WML = meanW-meanL

          summarize WML

          ttest WML==0

          Comment


          • #6
            Dear Zulfiqar,

            I have to calculate the momentum of stock returns, based on the eleven-month return starting twelve months prior to the measurement month and ending one month prior to that month. I used your code, but I was wondering if could verify if it is correct:

            bysort DSCode: gen MOM = Return_USD[_n-2]+ Return_USD[_n-3]+ Return_USD[_n-4]+ Return_USD[_n-5]+ Return_USD[_n-6]+ Return_USD[_n-7]+ Return_USD[_n-8]+ Return_USD[_n-9]+ Return_USD[_n-10]+ Return_USD[_n-11]+ Return_US[_n-12]

            Thank you so much!

            Comment


            • #7
              The above code suffers from several issues. It will not only take hours or days to complete due to the slow processing of the xtile command, but it also ignores the time series dimensions as it uses hard-coded observation gaps. Further, it ignores the overlapping dimension as mentioned in the Jegadesh and Titman paper.
              Since such strategies involve the overlapping formation and holding periods, the steps are usually more complicated than shown above in post #5. I have developed a customized Stata program, called asm.ado. This program offers lots of options related to momentum strategies. The program is available for a nominal fee. You can see further details here on my website
              https://fintechprofessor.com/stata-p...um-portfolios/
              Regards
              --------------------------------------------------
              Attaullah Shah, PhD.
              Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
              FinTechProfessor.com
              https://asdocx.com
              Check out my asdoc program, which sends outputs to MS Word.
              For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

              Comment

              Working...
              X