getCosts

Class: Portfolio

Obtain buy and sell transaction costs from Portfolio object

Syntax

[BuyCost,SellCost] = getCosts(obj)

Description

[BuyCost,SellCost] = getCosts(obj) obtains buy and sell transaction costs from the Portfolio object.

Tips

You can also use dot notation to obtain the buy and sell transaction costs from the Portfolio object.

[BuyCost, SellCost] = obj.getCosts;

Input Arguments

obj

Portfolio object [Portfolio].

Output Arguments

BuyCost

Proportional transaction cost to purchase each asset [vector].

SellCost

Proportional transaction cost to sell each asset [vector].

Attributes

Accesspublic
Staticfalse
Hiddenfalse

To learn about attributes of methods, see Method Attributes in the MATLAB® Object-Oriented Programming documentation.

Examples

expand all

Obtain Buy and Sell Costs

Given portfolio p with the costs set, obtain the values for BuyCost and SellCost.

p = Portfolio;
p = setCosts(p, 0.001, 0.001, 5);
[BuyCost, SellCost] = getCosts(p)
BuyCost =

   1.0000e-03


SellCost =

   1.0000e-03

See Also

Was this topic helpful?