You are on page 1of 8

asm: Stata Program to Construct J-K Overlapping

Momentum Portfolios

Attaullah Shah

Institute of Management Sciences, Peshawar

Email: attaullah.shah@imsciences.edu.pk
Working Paper

June, 2018

Abstract

In this technical report, I show how to use asm – a Stata program to


construct J-K overlapping momentum portfolios. Also, I outline
details of the primary functions/ features of the program. The
methods used in this program for constructing momentum portfolios
are generally in line with Jegadesh and Titman (1993). However, the
program offers additional features that were suggested/used in more
recent papers. For example, (i) the program offers to calculate one-
period as well as n-periods cumulative holding periods returns; (ii)
construct portfolios on the basis of winners and losers stocks that
can be defined using any deciles of their past returns; (iii) construct
momentum portfolios using daily, weekly, or monthly frequencies; (iv)
skip user’s specified n-periods between formation and holding
periods to control for bid-ask spread or non-synchronous trading and
(v) perform t-tests on the holding period returns.
Contents
Abstract .......................................................................................................... 1
1. Introduction ................................................................................................ 3
2. Program Requirements ................................................................................ 3
3. Program Syntax Format .............................................................................. 3
4. T-tests Results Reporting ............................................................................ 4
5. Skipping Periods between Formation and Holding ....................................... 4
6. Ranking Deciles .......................................................................................... 5
7. Results Directory ........................................................................................ 5
8. Reading the Output Files ............................................................................ 5
Variables Names for Holding Period Returns ................................................ 6
The Missing Rows ........................................................................................ 8
Program Download .......................................................................................... 8
1. Introduction
In a seminal paper, Jegadesh and Titman (1993) documented evidence of the
profitability of momentum portfolios. They calculated momentum portfolio
returns as the difference between current returns of past winners stocks minus
current returns of past losers stocks. For increasing power of their tests, they
used portfolios with overlapping holding periods. Thus, for a given month m, ,
they suggested to hold a series of portfolios that are selected in the current
month as well as in the previous K - 1 months, where K is the holding
period. Specifically, a strategy that selects stocks on the basis of returns over the
past J months and holds them for K months (referred as J-month/K-month
strategy) is constructed as follows: At the beginning of each month m,
the securities are ranked in ascending order on the basis of their returns in
the past J months. Based on these rankings, ten decile portfolios are
formed that equally weight the stocks contained in the top decile, the
second decile, and so on. The top decile portfolio is called the "losers" decile
and the bottom decile is called the "winners" decile. In each month m, the
strategy buys the winner portfolio and sells the loser portfolio, holding this
position for K months.

2. Program Requirements
The program written for momentum portfolio strategy is named as asm. asm
has the following three requirements.
• Stock returns named as ri
• Market returns named as rm
• Data set already declared as panel data, with the command xtset
If market returns are not needed, they can be omitted from the data set.

3. Program Syntax Format


asm follows the following syntax format:

asm # # , results dir(folder_name) bottom(#) top(#) skip(#) newey


lag(#) excel rtype(log | simple)

The underlined letters show that this is the minimum that the user will have to write
to invoke a specific option.
The first # after asm is to specify the number of formation periods, while the second #
is to specify the number of holding periods. For example,
asm 3 6

The above command uses formation periods up to 3 (i.e., J = 1, 2, 3) for ranking


stocks on their past J-periods lagged returns and holding periods up to 6 (i.e., K = 1,
2, 3, 4, 5, 6). The holding period momentum portfolio returns will be saved to the
directory “Results - F3 - T6 current_date_time” in the user’s current directory. A Stata
file with the name F3.dta, will be created in that directory. This file will have periodic
returns of winners’ stock (column WT), losers stock (LT) and winners minus losers
(WML) for holding period 6. Details of formation and holding periods’ returns are
given in Section 5 and 6.

4. T-tests Results Reporting


The program also offers to run t-tests on the momentum portfolio returns in
the holding period. This can be done by using the option results. For example
asm 3 6, results (can also be written as asm 3 6, r)
It will use up to 3 periods of formation and up to 6 periods of holding. The option
results tells the program that one sample t-test should be applied to the holding
periods’ momentum portfolio returns. This will generate MS Word files with names
Formation_1.doc, Formation_2.doc, and Formation_3.doc, each one of these files will
contain t-test results for each holding period returns.

5. Skipping Periods between Formation and Holding


Due to bid-ask spread problems and non-synchronous trading, research suggests that
one period should be skipped between formation and holding periods (see, Jegadesh
and Titman, 1993). asm offers the option to skip any desired number of periods
between formation and holding periods. This can be done using the option skip (#).

asm 3 6, results skip(1)


(Can also be written as asm 3 6, mg r s(1))
It will use up to 3 periods of formation and up to 6 periods of holding. The option
results tells the program that one sample t-test should be applied on the holding
period momentum portfolio returns. The option skip(1) tells the program to skip one
period between formation and holding period while estimating momentum portfolio
holding period returns. If more than one periods are to be skipped, the option skip will
take the form skip(#), i.e. for two periods skipping, the option will be skip(2) and so on.
The default value of skip is zero.
6. Ranking Deciles
Jegadesh and Titman (1993) used only top and bottom 10% stocks for ranking
winners and losers stocks. However, subsequent studies also used different deciles,
for example, using top and bottom 30% stocks for ranking of winners and losers
stocks. asm program offers the option of selecting any desired percentage for ranking.
See the example given below.
asm 3 6, bottom(0.3) top(0.7)

[Can also be written as asm 3 6, b(0.3) t(0.7)]


It will use up to 3 periods of formation and up to 6 periods of holding. The options
bottom (0.3) and top (0.7) tell the program the momentum portfolio returns should be
based on top 30% winners minus bottom 30% losers stocks. The default values for
bottom and top are 10.0001% and 90.0001%, respectively. If users need to specify any
other criteria, the bottom and top values can be changed accordingly.

7. Results Directory
asm saves results to a new directory each time it is run. The directory is made in the
user’s current directory with name structure of “Results – F# - T# - Current date current
time”. However, if the director option is used, the results will be saved to the user’s
specified directory. For example;
asm 3 6, results directory(Test1)
It will use up to 3 periods of formation and up to 6 periods of holding. The option
results tells the program that one sample t-test should be applied on the holding
period momentum portfolio returns. The options directory tells the program to make a
separate directory for momentum files and any other results file in the user’s current
directory with the name “Test1 current date_time”.

8. Reading the Output Files


asm creates a separate directory for results with the structure of “F_# - T_# - current
date current time” in the users current directory, and generates a clickable link to the
results directory once all processes are complete. It also offers the option of directory
(users specified directory name) with the structure of “user-specified name current
date time”. The program generates files with names F_1.dta, F_2.dta, F3.dta and so
on. The letter F refers to number of formation periods, thus for 5 formation periods i.e.
J = 1, 2, 3, 4, 5, the program will make five files with names ranging from F_1 to
F_5.dta. Each of these five files contain the following variables;
timevar WT# LT# WML#
Where timevar tracks the period in which the holding returns were calculated. WT#
refers to winner stocks returns using # number of holding periods. For example, for
one period of formation, we have the next period i.e. period 2 for holding. Immediately
after ranking of stocks on the basis of one period formation, the equally weighted
returns of top 10% stock (ranking is done on the basis of stock returns in period 1) in
the next holding period are recorded in variable WT1. Similarly, using one period
formation and 2 periods of holding, the first two periods are used in ranking and the
first holding period available starts from period 3. This way, the variable WT2 records
returns of top 10% stocks in the holding period that are two periods away from the
formation period.

Similarly, LT# refers to loser stocks returns using # number of holding periods. For
example, for one period of formation, we have the next period i.e. period 2 for holding.
Immediately after ranking of stocks on the basis of one period formation, the equally
weighted returns of bottom 10% stocks (based on the ranking in period 1) in the
holding periods are recorded in variable LT1. Similarly, using one period formation
and two periods of holding, the first holding period be available is from period 3. This
way, the variable LT2 records returns of bottom 10% stocks in the holding period that
are two periods away from the formation period.
And finally, WML# refers to the LT# minus WT# i.e. return of winner stocks minus
returns of losers stocks.

Variables Names for Holding Period Returns


Using one period formation and one period holding, the formation period
returns are available in period 1, however the holding period returns are
available from period 2. So the figures in Table 1 can be read as:
WT1= the average returns in holding period (i.e., one period after the formation)
of those stocks which were included in top 10% stocks in the formation period
in period 1
LT1 = the average returns in holding period (i.e., one period after the formation)
of those stocks which were included in the bottom 10% stocks in the formation
period in period 1
WML1 = WT – LT

Table 1: Holding period returns using one formation and four holding
periods
date WT1 LT1 WML1 WT2 LT2 WML2 WT3 LT3 WML3
1960m1
1960m2 0.016705 0.029236 -0.01253
1960m3 0.003381 -0.03921 0.042594 -0.04387 0.017505 -0.06137
1960m4 0.039224 -0.0128 0.05202 0.022803 -0.00248 0.025279 -0.00643 0.023637 -0.03007
1960m5 0.009822 -0.01022 0.020042 0.090786 -0.01649 0.10728 0.021073 0.002225 0.018849
1960m6 -0.09871 -0.18403 0.085317 -0.11556 -0.17509 0.059534 -0.12851 -0.19679 0.068281
1960m7 -0.03534 0.004865 -0.04021 -0.03031 0.014989 -0.0453 -0.03507 0.023387 -0.05846
1960m8 -0.05672 -0.02388 -0.03284 -0.02278 -0.07614 0.053362 -0.06324 -0.05961 -0.00363
The Missing Rows
In constructing formation period portfolios, we lose periods for which holding
period returns cannot be obtained. In one period formation-holding portfolios,
we lose the first period in forming the portfolio and hence the number of
holding periods available for portfolio construction are N – (NF + NH) - 1, where
N is the total number of periods available, NF refer to the number of formation
periods, and NH refers to number of testing periods. In Table 1, we use a total
of 10 periods, so for one period formation, we have a total of 9 holding periods
available. The first period is lost in formation. Similarly, for one period
formation and two periods holding (reported under WT2, LT2, WML2 columns),
we have 8 periods available for holding, that is, first periods is lost in formation
and the last period cannot be used for both formation and holding, hence
period number 10 is also lost. The same goes for other combinations.

Program Download

Download details are available at


http://www.opendoors.pk/home/paid-help-in-empirical-finance/stata-
program-to-construct-j-k-overlappy-momentum-portfolios-strategy
For any query or comments, please contact at
attaullah.shah@imsciences.edu.pk

**************

You might also like