Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

1. Open Yahoo .

Finance
2. At the top you will see search for News ,Symbols , stocks
3.  type TCS. in a dropdown we will see  many companies such as the container
Corporation, Tata Consultancy Services. choose tcs.NS and  hit return
4.  it will open up Tata Consultancy Services showing prices on National Stock
Exchange
5. Below the current TCS price you will see banner showing Summary ,chart, historical
Data et cetera
6.  choose  historical data. you will see  on the left hand side Time period. click on the
time period and choose dates from 1st February 2005 up to 1st February 2021 After 
clicking done , at the top banner you will see on the right hand side frequency. click
and choose monthly. 
7. Click apply and below that you will see  download.  click on download and save the
file in whichever folder you want. you can simply save it on desktop. it will be a csv 
file
8.  open the file in Excel. excel will ask you to confirm that it is a different format click
yes and it'll open the file.
9. Resize the column which is date so that you can see the date clearly. you can then
delete columns which are for open price high price low price adjusted close price and
volume. you can keep only column which gives close price. this is a file that we need
for further calculation. 
10. you can do the same thing for  any other script  such as Infosys or Wipro etc.
11. You will have to separate files TCS and another for Infosys.
12.  you need to bring both table into one single file.  you can cut paste the entire Infosys
date and close price column and paste it into TCS file. just check before proceeding
further that the number of records are exactly same  in both columns 
13. if you are at the top, simply press control shift and down arrow key. it will take you to
the last cell and you  should ensure that last  roll numbers of both columns TCS and
Infosys are same.

Detailed instructions for creating the variance-covariance matrix and envelope graph.
 
1.  Before you delete the date column which is appearing twice you can do one small
check that the dates are same for both TCS and Infosys in every row
2.  that is say that you have in column  A  date, second column TCS closing price third
column date for Infosys and fourth column Infosys closing price
3.  then  in the  fifth column,Second row, type a formula =a2= c2
4. If the date in column A and column C are same then it should  give a result  true
5.  copy paste this for  all the  rows and it should show true everywhere. if at any place
it is false then it would mean that the date in the column a and the date in the column
C are not matching and then you will have to check whether anything has been
missed out
6. To calculate monthly return for TCS we are using a formula (price on  1st March
minus price on 1st February )divided by price on 1st February.  same formula is used
for Infosys also. copy paste this formula for the  all the rows in the table. this is the
monthly return that you are getting from TCS and Infosys scrips.
7. You can calculate average of the returns over this time period simply by using
formula =Average( d5:d196)  ..  Here column D is only for  representation.  choose
the column and row number which is appropriate for TCS and Infosys, in your table
8.  in the file which I have used and which I will send it to you I have kept this numbers
In  column I and J.
9. These numbers are the mean Returns over the period 2005 2021 for TCS and
Infosys calculated on the basis of monthly Returns.
10.  to calculate covariance for  these two scrips ,Go to  data, which will be   at the top
where home insert are given. click on data  and on the right inside you will see 
solver and data analysis.
11.  click on data analysis  and   choose covariance. click ok.
12. In the input range, choose the range that you have calculated average  for  TCS and
Infosys, which will be in the column after Infosys close price. preferably  give a
header such as TCS and Infosys for these columns. after you have chosen the input
range click on labels (if you have given label otherwise don't click) and then choose
the cell where you want be covariance  to appear.  after clicking ok it will 
immediately create a  table for  TCS and Infosys
13. This table is for TCS and Infosys with weights of  Fifty Fifty Percent. if an investor has
fixed sum  and if he invest X percentage in TCS then investment in Infosys will be 
100 - X percentage.
14.   in this example we are considering a possibility that investor  may do short selling or
may Do forward purchase.  and hence we are  using a percentage from negative
50% to positive 150%
15.  please create a horizontal table of TCS and Infosys weightages. if you choose TCS
as negative- 0.5  the Infosys  will be 1 -  TCSweight. and in this particular place it will
show positive 1.5. you can copy paste  these two rows till you get  TCS weight as
positive   1.5.
16.  now we are calculating for these different portfolios where  the weight of TCS and
Infosys are changing what is the  return and what is  the variance covariance . 
17. Formula for  portfolio variance is  ( TCS variance* TCS weight  fraction squared+ 
Infosys variance* Infosys  weight fraction squared+ 2*Weight  fraction of Infosys*
weight fraction of TCS*covariance of TCS-Info sys squared )
18. Copy this formula for the entire row
19.  square root of this portfolio variance  is portfolio standard deviation. this is a
measure of risk associated with a Portfolio
20.  third row that we need to calculate is the weighted average return for this portfolio.
which will be  TCS average return* TCS weight fraction+ Infosys average return*
Infosys weight fractions. again copy this  formula for the entire row.  these numbers
are the returns that you are getting for the portfolio where the weight fraction of TCS
in Infosys are changing.
21.  now we are plotting return versus risk. so choose the portfolio return and Portfolio
standard deviation rows. .
22. go to insert and choose  scatter graph.  you can simply do this by typing keyboard
shortcut Alt,I,D . after choosing a suitable place, hit  enter. it will create a graph of risk
versus return
23.  you can then explain this graph in terms of envelope efficient portfolio in efficient
portfolio   etc.

You might also like