Welcome

to
Ganuenta

Actuarial & Financial Information
Systems


Design & Copyright
Axis® IT
Last revised: 2012-01-30

Building a stock portfolio

«A careful portfolio manager will probably invest in stocks from the blue chip list, building a sound portfolio, aiming at a decent steady average dividend income. Of course, shares will be sold but not as a rule. Under this policy selling short is a mortal sin.»



Stone tablet in wall Rijksmuseum Amsterdam
G A N U E N T A

Consultancy


Actuarial & Financial Information Systems
Middelburg - The Netherlands

Profit & Loss in Stocks
(from: samples | K | Show | Stocks)
Free Download (284Kb)


Determining Profit & Loss in a stock portfolio in a certain period of time is trivial when taking the algebraïc sum of the values of all stocks at the beginning of that period (balance), the value of the purchases and the values of the sales during that period.
However, if one is interested in which part is coming from or going into reservations for exchange rate differences, or which part may be considered as realized and which part is not, life is not that easy.
In that case the purchase value of the sold package is needed.
Two special cases need to be focused on:

  - the results of an entire portfolio during the financial
    year
  - the profit & loss on a particular stock in a FIFO-
    system.

In both cases a recursive function is needed, while case 2 involves the technique of splitting and assembling purchase packages of a particular stock, in order to assign the proper gains or losses on any sale transaction. This requires a second recursive funtion.
APL-like languages are extremely well suited for this purpose.
Please, have a look in the samples about how it is achieved.

Jan Karman
Middelburg (Neth), September 2006

More actuarial & financial applications:
 Actuarial Factors
 Annuity Loan
 Graduation of Mortality
 Profit & Loss in Stocks
 The Price of Bonds
 Annuïteitslening
 Afronding van sterftetafels
 Huishoudboekje
 Bevolkingspyramide
 Ausgleichung von Sterbetafeln
My Music
 Recent Compositions
 My Harpsichord
YouTube
Grand Fugue
Élégie

LinkedIn:
      Profile
 

Art:
      Art Gallery Orsmaal
      De Vleeshal Middelburg