computational analysis of stocks

42
1 GEK2507 GEK2507 Frederick H. Willeboordse [email protected] Compound & Prosper!

Upload: zorro29

Post on 29-Nov-2014

423 views

Category:

Business


3 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Computational Analysis of Stocks

1

GEK2507

GEK2507Frederick H. [email protected]

Compound & Prosper!

Page 2: Computational Analysis of Stocks

2

GEK2507

Stocks

Lecture 7

Page 3: Computational Analysis of Stocks

3

GEK2507

Today’s Lecture

What are Stocks

How can we find information about Stocks

How can we use Excel to keep track of our Stocks

Page 4: Computational Analysis of Stocks

4

GEK2507

Excel Basics – MIN & MAXSyntax:

Min gives the minimum of a set of numbers. Between the brackets, one can either list the numbers (cells) separated by commas, list a range, or combine the two: Eg. Min(B2:B6,C2)

Syntax:

Max gives the maximum of a set of numbers. Between the brackets, one can either list the numbers (cells) separated by commas, list a range, or combine the two: Eg. Max(B2:B6,C2)

Page 5: Computational Analysis of Stocks

5

GEK2507

Syntax:

AVERAGE calculates the arithmetic mean, i.e. it sums all the values and divides by the number of values. Between the brackets, one can either list the values (cells) separated by commas, list a range, or combine the two: Eg. AVERAGE(B2:B6,C2)

Syntax:

MODE returns the most frequently occurring value. Between the brackets, one can either list the numbers (cells) separated by commas, list a range, or combine the two: Eg. MODE(B2:B6,C2)

Excel Basics – AVERAGE & MODE

Page 6: Computational Analysis of Stocks

6

GEK2507

Syntax:

MEDIAN determines the median value, i.e. it is the value such that half the numbers listed is larger and half is smaller. Between the brackets, one can either list the values (cells) separated by commas, list a range, or combine the two: Eg. MEDIAN(B2:B6,C2)

Excel Basics – MEDIAN

Note: The median is a very important indicator and often more useful than the average as the meaning of an average can be strongly distorted by a single very different number. E.g. If Bill Gates were to live in Kent Vale (NUS staff housing), you could say that ‘on average’ NUS lecturers are multi-millionaires and hence very rich!

Page 7: Computational Analysis of Stocks

7

GEK2507

Excel Basics – MacrosA Macro is a series of commands that one can execute any time. While it is possible to do fancy programming, the good news is that macros can actually be recorded and even be assigned to graphics objects/buttons.

For Example, let us make a macro for changing the font etc, of a cell

Page 8: Computational Analysis of Stocks

8

GEK2507

Excel Basics – MacrosStep 1: Put Excel into the Macro recording mode:

Page 9: Computational Analysis of Stocks

9

GEK2507

Excel Basics – MacrosStep 1: Put Excel into the Macro recording mode:

Give the Macro a name

You can also define a convenient shortcut.

After clicking OK, you will see a little stop box appearing.

Page 10: Computational Analysis of Stocks

10

GEK2507

Excel Basics – MacrosStep 2: Do the things you want to do, e.g.

1) Format Cells

2) Change font etc.

3) Change Alignment to: Align Right

4) Click ‘Stop’ button

Page 11: Computational Analysis of Stocks

11

GEK2507

Excel Basics – MacrosStep 3: Run/Apply the Macro

1) Select a cell2) From the tools menu, choose Macro-Macros

3) When this box pops us choose which Macro you want to run

Result

Page 12: Computational Analysis of Stocks

12

GEK2507

Excel Basics – MacrosStep 4: Make a simple button

1) Click the rectangle button and draw it somewhere

2) Double-click on the newly-drawn rectangle to get the format box. Choose a new color and click ‘OK’.

Page 13: Computational Analysis of Stocks

13

GEK2507

Excel Basics – MacrosStep 5: Assign Macro

2) This box will pop up and allow you to choose the macro which you want to assign to the square.

1) Select the square, right-click on the mouse to obtain this menu and choose ‘Assign Macro’.

Page 14: Computational Analysis of Stocks

14

GEK2507

Excel Basics – MacrosStep 6: Run Macro

1) Select a Cell and click on the newly-made button.

And this is the result.

Page 15: Computational Analysis of Stocks

15

GEK2507

In order to setup a business or invest into new business one needs money!

Don’t we all ….

The natural question is of course: Where can we get that money for our earth-shattering idea.

One option would be to go to a bank …

Why Stocks

Page 16: Computational Analysis of Stocks

16

GEK2507

… but two problems are immediate.

A) Banks do not really like promises, they like solidityB) Banks charge interest, and that can be very

significant.

Would there be any better ways to get money?

Why Stocks

Page 17: Computational Analysis of Stocks

17

GEK2507

If you would want to set up a small company, you could ask some friends or family members to take a stake in return for partial ownership of your company.

Hey. That’s quite a good idea! You get money on a promise and you will not have to pay any interest. In return, if you are successful, your ‘stakeholders’ will get a share of the profits.

Great! A somewhat more formal implementation of this is the issuance of stock.

Why Stocks

Page 18: Computational Analysis of Stocks

18

GEK2507

When a company is setup, one can issue a certain number of Stock certificates. These certificates represent the partial ownership of the company.

The certificates then can be sold to investors who hope that the company (and thus the stock certificate) will increase in value.

Naturally, the detailed process is quite tricky and there are many laws governing this but the principle is very simple.

Why Stocks

Page 19: Computational Analysis of Stocks

19

GEK2507

Often the founder of a company buys all or a big part of the issued stock certificates.The founder then owns the certificates, but the company has the money.

There’s an important issue here. Companies that issue shares are considered legally independent entities. They therefore act and are treated like they were a thinking person.

We are quite used to this. We e.g. say: “I bought this from Creative” (Of course you didn’t, you bought it from the sales person).

Why Stocks

Page 20: Computational Analysis of Stocks

20

GEK2507

Just being able to buy the stock certificates when they are issued is not very practical.

Hence the Stock market was invented so that investors can trade (or sell/buy) stock certificates. To do so a stock needs to be ‘listed’ and fulfill certain conditions (hence this is only done for not-so-small companies).

Trading on the stock market can be difficult though which is why there are brokers who help you do the trading for a commission.

Why Stocks

Page 21: Computational Analysis of Stocks

21

GEK2507

It’s interesting to note that stock certificates are actual pieces of paper. In principle, when you buy a stock certificate you are entitled to get this piece of paper.

When the company whose stock you are buying is not listed on any stock market, you will get the certificate.

For listed companies, however, the moving around of the physical certificates is a big hassle so most investors will never ask for them and leave them stored in a central place.

Why Stocks

Page 22: Computational Analysis of Stocks

22

GEK2507

As always, a great place to find info is on the web:

Exchanges:

• http://www.nyse.com• http://www.nasdaq.com• http://www.simex.com.sg/

Brokers:

• http://www.etrade.com• http://www.poems.com.sg/

Why Stocks

Page 23: Computational Analysis of Stocks

23

GEK2507

Now let us assume that somehow you can buy and sell stocks and that you want to keep track of your investments.

Let’s start simply.

Stocks and Excel

Page 24: Computational Analysis of Stocks

24

GEK2507

A B C D E F G H23 My 1st portforlio Transactions Year 2000456 Date Action Stock Quantity Stock Price Total Price Total78 03/01/00 Buy YHOO 2 216 432 4329 28/02/00 Buy YHOO 2 158 316 74810 17/04/00 Buy MCD 10 35 350 109811 10/10/00 Sell YHOO 3 60 -180 91812131415

=IF(C11 = "Buy",E11*F11,-E11*F11)

=SUM($G$8:G11)

Stocks and Excel

Page 25: Computational Analysis of Stocks

25

GEK2507

A B C D E F G H23 My 1st portforlio Transactions Year 2000456 Date Action Stock Quantity Stock Price Total Price Balance78 03/01/00 Buy YHOO 2 216 432 4329 28/02/00 Buy YHOO 2 158 316 74810 17/04/00 Buy MCD 10 35 350 109811 04/09/00 Sell MCD 5 28 -140 95812 10/10/00 Sell YHOO 3 60 -180 77813

=IF(OR(C8 = "Buy",C8 = "Sell"),IF(C8 = "Buy",E8*F8,-E8*F8),"error")

This is nice, but what if we make a typo in column C?Fortunately the formula can be improved.

What a Monster! No, actually it’s quite straightforward.

Stocks and Excel

Page 26: Computational Analysis of Stocks

26

GEK2507

I guess buying Yahoo during the internet bubble was not such a good idea. This reminds me of:

A reporter asks Richard Branson (the flamboyant founder of Virgin):“How do you become a Millionaire?”

What do you think?

And he replies ……….

Stocks and Excel

Page 27: Computational Analysis of Stocks

27

GEK2507

“Start as a Billionaire and buy an Airline!”

Perhaps I should paraphrase …“Start as a Billionaire and become an Investor”

Stocks and Excel

Page 28: Computational Analysis of Stocks

28

GEK2507

The spreadsheet we just made can neatly keep track of our transactions but of course it doesn’t reflect at all the current value of our portfolio. In that sense it’s a rather useless spreadsheet.

So, let’s add a second sheet to keep track of this.

Stocks and Excel

Page 29: Computational Analysis of Stocks

29

GEK2507

A B C D E F G H I J K23 My 1st portfolio Valuations45 Total6 Date Qty Price Value Qty Price Value78 03/01/00 2 216 432 4329 28/02/00 4 158 632 63210 17/04/00 4 123 492 10 35 350 84211 04/09/00 4 104 416 5 28 140 55612 10/10/00 1 60 60 5 28 140 200131415

YHOO MCD

On this sheet we can enter the valuation of the portfolio.

This hurts!!!But how much?

Stocks and Excel

Page 30: Computational Analysis of Stocks

30

GEK2507

On the one hand we can of course say it hurts by 778 – 200 = 578 dollars (balance on 10/10/00 on slide 25 minus the remaining value on slide 29).

True … but since we’ve been buying and selling stocks, the absolute amount doesn’t necessarily mean much.

Somehow, it would be good if we could keep track of our performance more accurately so that we can compare ourselves to others. May be we didn’t do so badly…

but that’s outside the scope of this lecture (a useful Excel function in this context is XIRR ).

Stocks and Excel

Page 31: Computational Analysis of Stocks

31

GEK2507

There are all kinds of books … be aware of their quality!

On a related note. Financial Planners are all the rage now. It is surprising to see how many (intelligent) people entrust their money to often poorly qualified individuals.

In case of doubt, always go with ‘simple’, ‘big’, ‘well-known’, ‘trustworthy’ like e.g. NTUC, DBS, Schröders.

The following three books represent certain types of books. That doesn’t mean I recommend them.

Stocks and Books

Page 32: Computational Analysis of Stocks

32

GEK2507

This is quite a good book I think.

Stocks and Books

Page 33: Computational Analysis of Stocks

33

GEK2507

Another good book. Though, it looks quite flashy.

How do you know that this one is OK?Make your own judgment!

Stocks and Books

Page 34: Computational Analysis of Stocks

34

GEK2507

Well, this book looks similar to the one by Lynch.

The topics appear sound enough!

Stocks and Books

Page 35: Computational Analysis of Stocks

35

GEK2507

The book reads reasonable enough… until you consider what he doesn’t tell you. But this gives him away!

Stocks and Books

Page 36: Computational Analysis of Stocks

36

GEK2507

But here’s a book I fully recommend!

Stocks and Books

Page 37: Computational Analysis of Stocks

37

GEK2507

Stocks and Books

The best and worst performance of stock, bond, T-bills for various holding periods.

Note: T-bills are short term (generally 3,6 or 12 months) government securities.

Page 38: Computational Analysis of Stocks

38

GEK2507

Be aware! This is the nominal chart. I.e. inflation and taxes are not accounted for.

Stocks and Books

Page 39: Computational Analysis of Stocks

39

GEK2507

While less than the nominal numbers, the difference between the various classes is clear.

Stocks and Books

Page 40: Computational Analysis of Stocks

40

GEK2507

Stocks (recent charts)

Dow last 80 years.

Dow last 5 days.

Nikkei last 25 years.

Page 41: Computational Analysis of Stocks

41

GEK2507

Stocks (trading)

Trading is NOT investing!

Page 42: Computational Analysis of Stocks

42

GEK2507

Stocks play a key role in business

Excel is a great tool to keep track of financial data

Be critical of data as presented – know what they mean

You’d better not let me manage your money!

Key Points of the Day