American-transaction costs 1.0.0.0
American option pricer under proportional transaction costs
|
Holdings of cash and stock. More...
#include <portfolio.h>
Public Member Functions | |
void | accumulate (const coefficient R) |
void | accumulate (const ShortRate &r, const coefficient t1, const coefficient t2) |
void | buy (const coefficient s, const Spot &spot) |
coefficient | cash () const |
Portfolio & | operator*= (const coefficient scale) |
Portfolio & | operator+= (const Portfolio &portfolio) |
Portfolio | operator- () const |
Portfolio & | operator= (const Portfolio &portfolio) |
Portfolio (const coefficient shares=NAN, const coefficient cash=NAN) | |
coefficient | shares () const |
coefficient | value (const coefficient spot) const |
Holdings of cash and stock.
Portfolio::Portfolio | ( | const coefficient | shares = NAN , |
const coefficient | cash = NAN |
||
) | [inline] |
void Portfolio::accumulate | ( | const coefficient | R | ) | [inline] |
Cash accumulation at the rate R -1.
void Portfolio::accumulate | ( | const ShortRate & | r, |
const coefficient | t1, | ||
const coefficient | t2 | ||
) | [inline] |
Accumulates interest between t1 and t2 at the rate r.
void Portfolio::buy | ( | const coefficient | s, |
const Spot & | spot | ||
) | [inline] |
Buys (if positive) or sell (if negative) x shares. Cash is adjusted in self-financing way by using spot.
coefficient Portfolio::cash | ( | ) | const [inline] |
Amount of cash in the portfolio.
Portfolio& Portfolio::operator*= | ( | const coefficient | scale | ) | [inline] |
Multiplication operator.
Portfolio Portfolio::operator- | ( | ) | const [inline] |
Negation operator.
coefficient Portfolio::shares | ( | ) | const [inline] |
Number of shares in the portfolio.
coefficient Portfolio::value | ( | const coefficient | spot | ) | const [inline] |
computes notional value for a given notional share value