Beruflich Dokumente
Kultur Dokumente
Support System
Report of Multi-Disciplinary Project
Submitted to
Dr. Wasim A. Khan
Group Members
Abdul Arsalan Siddiqui
Danish Iqbal Allahwala
M. Salman Shahab
Syed Mohsin Mazher
Syed Umair Saleem
PREFACE
This report has been prepared for Dr. Wasim A. Khan as fulfillment of a partial
requirement for our ‘MIS Project’. The objective of preparing this report is to give an
insight of the different aspects of our project which we would be trying to cover and
methodology we would be applying to prepare our project.
For our project we would be following the ‘Portfolio Management Theory’ based on
an article written by Harry Markowiz titled ‘Portfolio selection’, which describes how
to combine assets into efficiently diversified portfolios.
The use and application of the variables and the methodology described in this report
are not to be taken as the best option to optimize a portfolio. The theories discussed
are not perfect and complete – no theory is. The content of this report only directs us
towards one of the applicable options of optimizing a portfolio. Therefore we have
started from a basic level so as to be able to cover as many options as possible and
avoid unnecessary complications in our project. However, an elementary knowledge
of how the markets works and familiarity with the terms used in the report would be
helpful in understanding the project.
2i
ACKNOWLEDGMENTS
The contribution of several individuals towards the preparation of the project and
compilation of this report is highly appreciated.
First of all we would like to thank Dr. Wasim A. Khan our project instructor for
providing us with an opportunity to work on this project, and for his help and
guidance at every stage of this report. The teachings of Mr. Ahmed Raza our course
instructor for ‘Quantitative methods in Business research’ have been very helpful in
understanding and stating the subject matter of this report and in the interpretation and
formulation of optimization problem.
We would also like to thank Mr. Syed Akbar Ali – Head Research Analyst at MCB
Asset Management and Mr. Imran Khan – Head of Research at First capital
Investments for their valuable time and sharing their expert opinion and the
knowledge of the market with us. Their contributions are highly appreciated.
3ii
TABLE OF CONTENT
EXECUTIVE SUMMARY ........................................................................................... 7
PROBLEM DEFINITION ............................................................................................ 8
PROPOSED SOULUTION........................................................................................... 9
2.1 MODULE I: INVESTMENT SUPPORT SYSTEM (ISS) ................................. 9
2.2 MODULE II: INVESTMENT DECISION SUPPORT SYSTEM (IDSS) ......... 9
2.3 MODULE III: - RETURN AND INVESTMENT MONITORING (RIM) ...... 10
KARACHI STOCK EXCHANGE ............................................................................. 11
3.1 INTRODUCTION OF KSE-100 INDEX ......................................................... 11
3.1.1 Calculation Methodology ........................................................................... 11
3.1.2 Calculating the KSE-100 ............................................................................ 11
3.1.3 Calculating the KSE-100 Index.................................................................. 12
3.2 INTRODUCTION OF KSE-30 INDEX ........................................................... 12
3.2.1 Free-Float Methodology............................................................................. 13
3.2.2 Base Period................................................................................................. 13
3.3 KSE 30 INDEX LISTED COMPANIES .......................................................... 14
PORTFOLIO DEVELOPMENT AND MANAGEMENT ......................................... 15
4.1 PORTFOLIO THEORY.................................................................................... 15
4.2 BASIC COMPUTATION REGARDING PORTFOLIO MODEL .................. 15
4.2.1 Return Calculation...................................................................................... 15
4.2.2 Covariance and Calculation of Portfolio Variance .................................... 16
4.2.3 Correlation Matrix ...................................................................................... 17
4.3 BASIS TO DEVELOP A WELL DIVERSIFIED PORTFOLIO ..................... 17
4.3.1 Correlation Coefficient ............................................................................... 17
4.3.2 Dissimilar Price Movements ...................................................................... 17
4.3.3 Diversification ............................................................................................ 17
4.3.4 Effective Diversification ............................................................................ 18
4.3.5 Efficient Frontier ........................................................................................ 18
4.3.6 Efficient Portfolio....................................................................................... 18
4.3.7 Expected Return ......................................................................................... 18
4.3.8 Risk............................................................................................................. 19
4.3.9 Risk Tolerance............................................................................................ 19
4.3.10 Standard Deviation ................................................................................... 19
4.3.11 Variance Reduction .................................................................................. 19
4.4 OUTCOME OF A WELL DIVERSIFIED PORTFOLIO ................................ 20
4.4.1 Asset Allocation ......................................................................................... 20
4iii
4.4.2 Investment Policy Statement ...................................................................... 20
4.4.3 Optimal Portfolio........................................................................................ 20
4.4.4 Passive Management .................................................................................. 20
2.4.5 Re-Optimization ......................................................................................... 21
SYSTEM DESIGN ..................................................................................................... 22
5.1 USE CASE DIAGRAM .................................................................................... 22
5.2 DATA FLOW DIAGRAM ............................................................................... 23
5.2.2 Level 0 DFD ............................................................................................... 23
5.2.3 Detailed DFD ............................................................................................. 24
5.2.3.1 Detailed DFD of ISS ........................................................................... 24
5.2.3.2 Detailed DFD of Portfolio Calculation ............................................... 25
5.2.3.3 Detailed DFD of Buy/Sell Call Generation......................................... 25
5.3 UML ACTIVITY DIAGRAM .......................................................................... 26
5.3.1 Activity Diagram ISS ................................................................................. 26
5.3.2 Activity Diagram IDSS .............................................................................. 27
5.4 ENTITY RELATIONSHIP DIAGRAM ........................................................... 28
5.4.1 ERD Description ........................................................................................ 28
5.4.1.1 Stock .................................................................................................... 28
5.4.1.2 Sector................................................................................................... 29
5.4.1.3 Price..................................................................................................... 30
5.4.1.4 Beta_n_Return ..................................................................................... 30
5.4.1.5 Portfolio............................................................................................... 31
5.4.1.6 PLP ...................................................................................................... 31
5.4.1.7 Bought_ Stocks ................................................................................... 32
5.4.1.8 Sell_Call .............................................................................................. 32
5.4.1.9 Buy_Call.............................................................................................. 33
5.5 LAYOUT OF FRONTEND .............................................................................. 34
THE PORTFOLIO SELECTION PROBLEM ........................................................... 35
6.1 PROBLEM FORMULATIONS ........................................................................ 35
6.1.1 Minimize Variance Subject To Given Return ............................................ 35
6.1.2 Maximize Return Subject To Given Variance ........................................... 35
6.2 COMBINING THE MODELS.......................................................................... 35
6.2.1 Balancing Risk and Return......................................................................... 35
5iv
TABLE OF FIGURES
v6
EXECUTIVE SUMMARY
The objective of this project is to develop an application software, that uses the
historic price data of 30 companies listed on KSE, in order to develop an Optimal
Portfolio of stocks based Mean Variance Optimization Model that maximizes the
return to an investor while satisfying his/her risk taking propensity.
The project is concerned about developing an application that facilitates the investor
in the selection of optimal combination of assets on their investment portfolio so that
they can maximize return on their investments with a given level of risk assumed. The
basis of the software is the Mean Variance Optimization Method.
The project is executed in two phases; first phase includes the complete understanding
of the problem and proposing different solutions. Then different solutions are
analyzed in order to get the best possible solution. Once a solution is selected a
complete system design is developed including the hardware and software design.
7
PROBLEM DEFINITION
“To develop an application software, that uses the historic price data of 30 companies
listed on KSE, in order to develop an Optimal Portfolio of stocks based Mean
Variance Optimization Model that maximizes the return to an investor while
satisfying his/her risk taking propensity”
The project is concerned about developing an application that facilitates the investor
in the selection of optimal combination of assets on their investment portfolio so that
they can maximize return on their investments with a given level of risk assumed. The
basis of the software is the Mean variance optimization method.
Portfolio theory assumes that for a given level of risk, investors prefer higher returns
to lower returns. Similarly, for a given level of expected return, investors prefer less
risk to more risk. It is standard to measure risk in terms of the variance, or standard
deviation, of return. We measure return as the average annual rate. Therefore, we
want to develop an efficient portfolio, that is, one in which there is no other portfolio
that offers a greater return with the same or less risk, or less risk with the same or
greater expected return.
As many of us can imagine, all of the stocks traded in the stock market do not move
together. In general the market has been moving up, but at the same time there are
stocks that are losing value. There are some stocks that tend to move together, some
that move in opposite directions, and others that seem to have no relation to one
another. This tendency to move together or opposite can be measured by covariance
(or if scaled, correlation). By using the covariance, we can measure the variability or
risk in our portfolio. To reduce the volatility of the entire portfolio, it makes sense to
include some stocks that move in opposite directions1.
1
http://www-new.mcs.anl.gov/otc/Guide/CaseStudies/port/introduction.html
8
PROPOSED SOULUTION
The software we are going to develop under this project will be comprise of three
modules and will work as described below.
The module start working with the calculation of beta of individual stock, then it takes
input from the user regarding sectors of interest in which he intends to invest.
After getting the input from the user, system will automatically retrieve data like
target price, beta, current market price and data regarding return potential.
Then the system will match return potential with the return cushion (As per business
rule) to identify the sectors which has require return potential.
After selecting companies with the required return potential the system will calculate
the beta of portfolio (proposed) with different combination of stock and calculate the
return of those portfolios with beta close to 1.
For the no. of proposed portfolio the system will also perform some additional
calculations to select the best portfolio for investment. These checks include:
• Market capitalization
• Free float of individual stock in the portfolio
• Value traded
• Impact cost
• The system will help the investor/manager to monitor the stock prices in order
to make decision regarding selling and buying of the stock. The system will
generate a sell call/ buy call after analyzing certain sets of a data daily with a
frequency of 3 to 5 runs per business day.
• System calculates the difference between the weight of the bought stocks and
weight of the stock in the optimal portfolio and with the weightage of the
stock defined by the user to generate a sell call.
• If the difference between the target price and the current market price of the
stock is reduced to a certain level given by user system will generate a sell call
to offload the investment.
• System will also generate a buy call if the user includes a certain stocks in
prospective list of purchasing (PLP). The buy call only triggers when the
return potential is greater than or equal to return cushion and the stock name is
entirely in the PLP.
9
• System will also generate sell call for the whole portfolio with preference
given to those stocks which close to their target price if the index hits below a
certain level to minimize losses.
This module of the software will build record of the stocks that have been purchased
by the investor and also calculate the return of individual stock and portfolio on every
sale proceeds. This system will also calculate the return generated from the Fixed
Income Investment (Idle Cash).
This list includes the name of the stocks recommended by Module I to be invested in
and also the priority rating .It also provides details about the investment that one can
make in particular stocks.
The system will have an updated list of SoP when the purchase is made or any sale of
stocks is done. This list will provide the investor a quick report of the investment and
the weights of investment in the individual sector.
Sell call and buy call generated by the system is update to the list called TBS i.e. to be
sol if the sell call is generated and to the list called TBP i.e. to be purchased if the buy
call is generated. These lists will provide quick information to the user
(investor/broker) in order to select the stocks for buying and selling.
10
KARACHI STOCK EXCHANGE
This is the market place where financial investment (normally of long term nature)
can be acquired or disposed off. The stock exchange (also referred to as stock market)
is where shares and bonds issued by business entities (companies) are traded. There is
sub category called the money market which is normally the market for acquiring and
disposing of financial investments. Financial investments are normally represented by
certificates generally referred to as security.
The KSE-100 index comprises of 100 companies selected on the basis of sector
representation and the highest market capitalization. The KSE-100 index was
introduced in November 1999 with the base value of 1000 points. These 100 listed
companies capture around 80% of the total market share. One company from each
sector is selected on the basis of largest market capitalization and the remaining 66
companies are selected on the basis of largest market capitalization in descending
order. The primary objective of the KSE100 index is to have a benchmark by which
the stock price performance can be compared to over a period of time. In particular,
the KSE 100 is designed to provide investors with a sense of how the Pakistan equity
market is performing
In a very layman term, the KSE-100 index is a basket of price and the number of
shares outstanding. Thus, the value of basket is regularly compared to a starting point
or a base period. To make the computation simple, the total market value of base
period has been adjusted to 1000 points. For making other to understand this
computation we take an example.
Taking stock A’s share price of Rs. 20 and multiplying it by its total common shares
outstanding of 50 million in the base period provides a market value of one billion
Rupees. This calculation is repeated for stocks B and C with the resulting market
values of three and six billion Rupees, Respectively. The three market values are
added up, or aggregated, and set equal to 1000 to form the base period value. All
future market values will be compared to base period market value in indexed form.
Step 1
Table 1.1: The Base Period Day 1
11
3.1.3 Calculating the KSE-100 Index
Step 2
Table 1.2: Index Value as on Day 2
11,000,000,000.00
Index = ————————————— = 1.10 * 1000 = 1100
10,000,000,000.00
Or
Market Capitalization
————————————— x 1000
Base Divisor
The KSE100 Index calculation at any time involves the same multiplication of share
price and shares outstanding for each of the KSE100 Index component stocks. The
aggregate market value is divided by the base value and multiplied by 1000 to arrive
at the current index number.
The primary objective of the KSE-30 Index is to have a benchmark by which the
stock price performance can be compared to over a period of time. In particular, the
KSE-30 Index is designed to provide investors with a sense of how large company’s
scrips of the Pakistan’s equity market are performing. Globally, the Free-float
Methodology of index construction is considered to be an industry best practice and
all major index providers like MSCI, FTSE, S&P, STOXX and SENSEX have
adopted the same.
12
account only the market capitalization of free-float shares of a company for the
purpose of index calculation.
Free-Float means proportion of total shares issued by a company that are readily
available for trading at the Stock Exchange. It generally excludes the shares held by
controlling directors/sponsors/promoters, government and other locked-in shares not
available for trading in the normal course.
Free-Float calculation can be used to construct stock indices for better market
representation than those constructed on the basis of total market capitalization of
companies. It gives weight for constituent companies as per their actual liquidity in
the market and is not unduly influenced by tightly held large-cap companies. Free-
Float can be used by the Exchange for regulatory purposes such as risk management
and market surveillance.
Free-float XXX
The base period of KSE-30 Index is June 2005 and the base value is 10,000 index
points. This is indicated by the notation 2005 = 10,000. The calculation of KSE-30
Index involves dividing the free-float market capitalization of 30 companies in the
Index by a number called the Index Divisor. The Divisor is the only link to the
original base period value of the KSE-30 Index. It will keep the Index comparable
over a period of time and will also be the adjustment point for all future corporate
actions, replacement of scrips etc.
13
3.3 KSE 30 INDEX LISTED COMPANIES
14
PORTFOLIO DEVELOPMENT AND MANAGEMENT
4.1 PORTFOLIO THEORY
“If two portfolios have the same expected return, the one with the lower volatility will
have the greater compound rate of return.” Both risk is reduced and compound rates
of return are enhanced simultaneously2. Modern portfolio theory enables an investor
to classify, estimate, and control both the kind and amount of expected risk and return
as measured statistically. It is also called “Modern Portfolio Theory” or “Portfolio
Management Theory”. Holding securities that tend to move in concert with each
other does not lower one’s risk. In other words, the average risk of a portfolio is not
the average of the individual component investments of the portfolio if all of their
prices move in tandem or in concert with each other. Therefore, what may be
perceived to be a low risk portfolio could actually be a high-risk portfolio and vice
versa. Diversification reduces risk only when assets are combined whose prices move
inversely or at different times in relation to each other.3
In our application various return are to be calculated that will serve as the input to the
application in order to calculate the return on the portfolio.
Total Return represents one of the easiest estimations, which also includes
dividends as part of our considerations. The formula for calculating total
return is:
Example: An investor purchased a stock for Rs. 6000. At the end of the year
the stock is worth Rs. 7500. Therefore, he has an unrealized gain of Rs. 1,500.
He was paid dividends of Rs. 260. So, total return is calculated as follows:
2. Simple Return
Simple return calculations are executed after you have sold the investment.
The formula you use to calculate it is:
2
“Portfolio Selection,” H. Markowitz, Journal of Finance, March, 1952, pp. 77-91
3
Asset Allocation for Institutional Portfolios, Mark P. Kritzman, CFA, Business One Irwin, 1990
15
The Total Return of individual stocks will help in calculating the return of
optimal portfolio and also in the selection of the optimal portfolio as it serve as
an input to the portfolio optimizer model.
Simple return is used in the calculation of return on the individual stocks held
for specific period in the firm’s investment portfolio.
Portfolio return is just the weighted average of the returns of the individual
securities in the portfolio.
Rp= WA * rA+ WB * rB
The calculation of the portfolio expected return is a fairly straightforward. But the
calculation of the standard deviation and variance of the portfolio is more
complicated, because portfolio variability (standard deviation) is not the weighted-
average of the variability of the individual assets. Diversification reduces the
variability of the portfolio, because the prices of different assets vary differently. The
decrease in price of one asset is compensated by the price growth for another.
For calculation of the variance σ² and the standard deviation σ of the portfolio return,
we first calculate the covariance between assets A and B. Covariance is the measure
of how much returns of two assets vary together. This is distinct from variance, which
measures how much a single asset varies.
It follows from the formula above, that the covariance of an asset with itself σ11 is its
variance σ1².
ρAB = σ AB /σAσB
The correlation coefficient ρ12 and the covariance σ12 are positive, if the returns of
assets move in the same direction (in most cases). Correlation and covariance are
4
http://learning.mazoo.net/archives/001380.html
5
http://learning.mazoo.net/archives/001380.html
16
negative, when returns move in the opposite directions. If the returns are independent
then the correlation coefficient is 0.
4.3.3 Diversification
6
http://learning.mazoo.net/archives/001380.htm
7
Asset Allocation for Institutional Portfolios, Mark P. Kritzman, CFA, Business One Irwin, 1990, pp.
11-18.
17
4.3.4 Effective Diversification
While all diversification is good, certain types of diversification are better. This was
the premise of Harry Markowitz’s Nobel Prize winning theory. He showed that to the
extent that securities in a portfolio do not move in concert with each other, their
individual risks can be effectively diversified away. Diversification among securities
that move together is ineffective diversification. Effective diversification reduces
portfolio price fluctuations and smoothes out returns. Generally, anything that reduces
price fluctuations increases compound returns.8
Effective diversification requires that chosen and combined assets that are measured
statistically to have dissimilar price movements.
A portfolio that offers the maximum level of expected return for any level of risk or
alternatively a portfolio that has the minimum level of risk for any level of expected
return.10 The combination is arrived at mathematically, taking into account the
expected rate of return and standard deviation of returns for each security as well as
the similarity or dissimilarity of price movements (and their magnitude) between
securities in the portfolio.11 Only by selecting investments that have dissimilar price
movements one can diversify away risk, reduce volatility, and increase compounded
rates of return at the same time. Harry Markowitz, called portfolios that have
dissimilar price movement diversification “efficient portfolios.” This strategy is
based on the “Modern Portfolio Theory” concept.
8
“Building an Investment Plan” Dimensional Fund Advisors, Inc., August, 1991, p. 6.
9
Asset Allocation for Institutional Portfolios, Mark P. Kritzman, CFA, Business One Irwin, 1990, pp.
19-20.
10
Asset Allocation for Institutional Portfolios, Mark P. Kritzman, CFA, Business One Irwin, 1990,
p.19.
11
Dictionary of Finance and Investment Terms, Third Edition, Barron’s Educational Series, 1991.
18
estimated returns and are in no way returns for the investments that comprise the
portfolio.12 The success of the strategy is highly dependent upon the assumptions
made to calculate the expected return. The expected rate of return is what the prudent
investor attempts to maximize at his selected level of risk.
4.3.8 Risk
Risk is the possibility of financial loss and/or uncertainty of future rates of return. Its
derivation comes from the fact that the future cannot be accurately forecasted. The
less certain we are that an asset’s actual return will be close to its expected return, the
more risk that asset carries. Historical variance or volatility (risk) of an investment
can be statistically measured using standard deviations. The return of an investment is
set according to its perceived risk lower the risk the lower the return. Harry
Markowitz showed that to the extent a diversified portfolio has assets that do not
move in concert with each other, risk can be diversified away while maintaining and
actually increasing return.13
Each investor has his own risk tolerance. It is the trade-off between risk the investor is
willing to take to receive a specified expected rate of return in light of his financial
condition, objectives and needs. Investor risk levels range from defensive to
aggressive. Investors will tolerate slightly higher risks for higher expected rates of
return along a utility curve.
Markowitz showed that for a given expected return, reducing a portfolio’s variance
increases the compound rate of return. For example, a $100 portfolio that is up 20% in
one period and unchanged in a second period has $120 after the two periods. If we
reduce the portfolio’s variance to zero (up 10% the first period and up 10% the second
period) we maintain our average rate of return (of 10%) but end up with $121 after
the two periods, increasing our compounded rate of return. “Modern Portfolio
Theory” is based on the following concept:
“If two portfolios have the same expected return, the one with the lower volatility will
have the greater compound rate of return.”14
12
Dictionary of Finance and Investment Terms, Third Edition, Barron’s Educational Series, 1991.
13
Asset Allocation for Institutional Portfolios, Mark P. Kritzman, CFA, Business One Irwin, 1990
14
”Portfolio Results Enhanced--Using Markowitz increases returns without added risk,” Joseph N.
Papp, Pension & Investments, February 18, 1991.
19
4.4 OUTCOME OF A WELL DIVERSIFIED PORTFOLIO
Well diversified portfolio will return the weights of the individual securities that have
to be included in to the investment portfolio in order to minimize risk and maximize
the return on investment. Allocation of investment funds among categories of assets,
such as cash equivalents, stocks and fixed-income investments is also the subject of
asset allocation that is considered by the prudent investor. Asset allocation affects
both risk and returns and is a central concept in personal financial planning and
investment management. The extent to which investments chosen for allocation move
dissimilarly, it will determine whether the allocation of assets provides effective
diversification or not.
The process that defines in statement form, the investor’s financial objectives, the
amount of funds available for investment, the investment methodology and the
strategy that will be used to reach those objectives. The strategy is customized and
matched to investors’ individual needs, objectives and chosen risk tolerance levels.
After all efficient portfolios have been identified; the particular portfolio that is most
suitable to the investor is the optimal portfolio. “Most suitable” refers to the portfolio
that best represents the balance between investor’s stated risk tolerance and the related
expected return. Normally investors will accept moderately higher levels of risk for
higher expected rates of return. Those portfolios that fit within the range of their risk
and reward criterion can be placed on a curve, called the utility curve or indifference
curve (and sometimes the risk tolerance curve). In practice, however, expected utility
curves can be somewhat indeterminate because seldom can most investors quantify
their acceptable levels of risk as it relates to expected return. The optimal asset mix is
defined as that point along the efficient frontier that is tangent to one’s desired utility
curve, or risk tolerance curve. “The optimal portfolio is that portfolio that has the
highest expected return that matches up with the risk and related return of the utility
curve for a specific investor” 15
20
The concept of passive management provide the basis to develop a software program
to automate the process of developing the optimal portfolio that can be easily fine
tuned with the help of the software like PMSS.
2.4.5 Re-Optimization
21
SYSTEM DESIGN
The steps followed to design the PMSS (Portfolio Management and Support System)
are as follows:
A use case diagram is a type of behavioral diagram and its purpose is to present a
graphical overview of the functionality provided by a system in terms of actors (i.e.
users), their goals, and any dependencies between them. The main purpose of a use
case diagram is to show what system functions are performed for which actors.
In PMSS there are three actors that interact with the system; investor who is the actual
user of the system, KSE (Karachi Stock Exchange) that provides all the primary data
and broker who performs the physical buying and selling of shares when the system
tells him to do so. Use case diagram of PMSS is given below.
22
5.2 DATA FLOW DIAGRAM
A data flow diagram (DFD) is a graphical representation of the "flow" of data through
an information system. There are three levels of DFD’s:
This level shows the overall context of the system and its operating environment and
shows the whole system as just one process. The entities here are the real world
organizations, people or systems that interact with the system in any way.
This level shows all major processes, data stores, external entities and the data flows
between them. The purpose of this level is to show the major high level processes of
the system and their interrelation. A level 0 diagram must be balanced with its parent
context level diagram, i.e. there must be the same external entities and the same data
flows, these can be broken down to more detail in the level 0.
23
Figure 5.3: Level 0 DFD of the System
This level is a decomposition of all the processes shown in level 0 diagram as such
there should be a level 1 diagram for each and every process shown in a level 0
diagram. Since our system has three major processes as shown in Level 0 DFD, each
of those processes will be shown in a separate detailed DFD.
24
5.2.3.2 Detailed DFD of Portfolio Calculation
25
5.3 UML ACTIVITY DIAGRAM
Activity diagram tells us the working of modules in the system. There are only two
activity diagrams of the system because the third module is just for monitoring and it
does not perform any calculation and is running on the backend of the system.
26
5.3.2 Activity Diagram IDSS
27
5.4 ENTITY RELATIONSHIP DIAGRAM
5.4.1.1 Stock
This entity depicts the real world object of ‘Organization’. In this table all the
information pertaining to a company whose shares is traded in the market are stored.
It stores the basic data of individual companies.
28
Stock_ID
This is the primary key or the unique identifier of the table. ‘Stock_ID’ is just a
number allocated to each company for the purpose of uniquely identifying them.
Stock_Name
Shares_Outstanding
Every company in the stock market issues shares which are commonly known as
outstanding shares. The total number of shares that a company issues in the open
market for trading purpose is stored in this attribute.
Market_Cap
Traget_Price
This is the fair value or actual value of the company’s share in the market. This is
calculated on the basis of current and future earnings of the company. It is the actual
value a company’s share should have if the market was fully efficient (i.e. any
information about the company is incorporated in its share’s price as soon as the
information comes).
Sector_ID
This is a foreign key in the ‘Stock’ table. ‘Sector_ID’ comes from the table ‘Sector’
which stores the names and ID’s of the sectors to which companies trading in the
stock market belong to.
Stock_Weight
This is the total amount that can be invested in a particular company’s stock. It is
stored as a percentage.
5.4.1.2 Sector
Sector_ID
This is the primary key or the unique identifier of the table ‘Sector’. ‘Sector _ID’ is
just a number allocated to each sector for the purpose of uniquely identifying them.
Sector_Name
29
5.4.1.3 Price
Stock_ID
‘Stock_ID’ is not just a foreign key that comes from the table ‘Stock’ but it is also a
part of the primary key that uniquely identifies each and every record in the table.
‘Stock_ID’ along with ‘Price_Date’ composes the composite primary key of the table.
Price_Date
As mentioned above it is a part of primary key of the table and it stores the date on
which the price of the stock was taken.
Price
This is the most important attribute of the database which stores the historical per
share price of a company’s stock from January 1, 2004. All the calculation of beta and
return potential are based upon this attribute.
Turnover
This attribute stores the daily quantity of shares being traded in the market of
individual companies since January 1, 2004.
5.4.1.4 Beta_n_Return
Stock_ID
‘Stock_ID’ is not just a foreign key that comes from the table ‘Stock’ but it is also a
part of the primary key that uniquely identifies each and every record in the table.
‘Stock_ID’ along with ‘BnR_Date’ composes the composite primary key of the table.
BnR_Date
As mentioned above it is a part of primary key of the table and it stores the date on
which the beta of the stock was calculated. It is important to store the date to keep
track of the change in beta of the stock because beta is the measure of risk of
individual stock compared to the market and it can change with the changing prices of
the stock and the market index due to high volatility of the market.
BnR_Beta
It stores the beta of individual stock which is the relationship of stock with the market.
It tells us about the movement of stock in comparison to the market.
BnR_ReturnPotential
This attribute stores the return a stock can give us if we buy it on the particular date. It
is shown as a percentage and calculated as the percentage change between the market
price on that date and the target price of the company’s stock.
30
BnR_Variance
Variance of the stock is the measure of its variability from the mean or par value. This
value is stored in ‘BnR_Variance’ and it helps us measure the highs and lows of a
stock.
BnR_CoVariance
Covariance is the measure of relationship between a stock and market and this helps
us in calculation of beta and standard deviation of the portfolio we intend to propose.
The value of covariance is stored in ‘BnR_CoVariance’.
5.4.1.5 Portfolio
Portfolio_ID
This is just a number used to uniquely identify the records in the table.
Portfolio_Number
This is like a serial number the system will give to each portfolio that it will generate.
This is important to keep track of all the portfolios the investor (i.e. user of the
system) has.
Portfolio_Date
Portfolio_StockID
This is the same number that we gave to each of our stocks in the stock table. The
reason that this ‘Portfolio_StockID’ is stored in the table is to tell us the stocks that
the system included in the proposed portfolio.
Portfolio_StockWeight
This attribute stores the weight (in percentage) that each stock in the portfolio has.
5.4.1.6 PLP
PLP_ID
This is the primary key or the unique identifier of the table. ‘PLP_ID’ is just a number
allocated to each company for the purpose of uniquely identifying them.
PLP_PortfolioNum
This is the primary key that comes from the table ‘Portfolio’. This attribute holds the
ID’s of bought portfolios so that they can be sold in future.
31
PLP_StockID
‘PLP_StockID’ is a foreign key stored in this table that comes from the table ‘Stock’.
‘PLP_StockID’ is stored to give the system some flexibility and it gives the investor
to add his favorite stocks in the PLP so that they can be monitored individually and as
soon as they show some potential of future profits they can be bought.
Stock_ID
This is the primary key or the unique identifier of the table. ‘Stock_ID’ is just a
number allocated to each company for the purpose of uniquely identifying them. In
‘Bought_Stocks’ the stocks that are bought by the investor are kept.
Bought_Price
‘Bought_Price’ stores the prices on which each of the stocks was bought.
Bought_Quantity
This attribute tells us the quantity or number of shares of the particular stocks that
were bought by the investor.
5.4.1.8 Sell_Call
SellCall_ID
This is just a number used to uniquely identify the records in the table.
SellCall_Date
‘SellCall_Date’ is the date on which the sell call was generated. ‘Sell_Call’ as the
name suggests generates an order to sell shares to the broker automatically.
SellCall_PortfolioNum
This attribute stores the number of portfolio of which the stock was a part. It is a
foreign key that comes from the table portfolio.
SellCall_StockID
SellCall_Price
As the name suggests ‘SellCall_Price’ stores the price at which the stocks are being
sold.
32
SellCall_Quantity
It stores the number of shares that are sold by the broker due to the generation of sell
call.
5.4.1.9 Buy_Call
BuyCall_ID
This is the primary key or the unique identifier of the table. ‘BuyCall_ID’ is just a
number allocated to each company for the purpose of uniquely identifying them.
BuyCall_Date
‘BuyCall _Date’ is the date on which the buy call is generated. ‘Buy_Call’ as the
name suggests generates an order to buy shares to the broker automatically.
BuyCall_StockID
BuyCall_Price
BuyCall_Quantity
It stores the number of shares that are bought by the broker due to the generation of
buy call.
33
5.5 LAYOUT OF FRONTEND
34
THE
HE PORTFOLIO SELECTION PROBLEM
6.1 PROBLEM FORMULATIONS
If you understand the concept of efficient portfolios, we are now ready to talk about
problem formulations. We will first talk about two commonly used formulations that
may not produce efficient portfolios. The first is to minimize variance subject to
achieving
ieving a specified level of return and the other is to maximize return subject to
achieving a specified level of variance. Let the portfolio have an expected return of
z = rTw and variance of .
These models will not necessarily give efficient portfolios. The first model will
provide a portfolio having the smallest standard deviation for a specified minimum
level of return. However, there may exist a portfolio having a greater return and an
equivalent
lent standard deviation. In such a case, the portfolio returned by the model
would not be efficient. These can happen only if the matrix Q is not strictly positive
definite.
Each investor is willing to take a certain amount of risk to earn another dollar in
returns. As the total return goes up, the investor is less and less willing to risk more to
earn just one more dollar. Each investor has a certain utility for money, which
determines exactly how much risk he is willing to take in order to obtain an expected
amount of money. We assume that this utility can be measured by a utility function,
u(x). One commonly
monly used utility function is:
35
u(x) = 1 - exp(-kx), where k > 0 is a riskk aversion constant. This function describes
the relationship between risk
r and return for an investor.
We assume that the return vector is normally distributed with mean r and covariance
matrix Q. Therefore, z is also normally distributed with mean z = rTw and variance
. The expected value of utility can then be computed as
Now, given a covariance matrix, Q,, a vector of expected returns, r, and a risk-
aversion parameter, k,, we can select a portfolio that maximizes expected utility by
solving the following optimization problem:
36