setCosts
Set up proportional transaction costs for portfolio
Description
sets up proportional transaction costs forobj
= setCosts(obj
,BuyCost
)Portfolio
,PortfolioCVaR
, orPortfolioMAD
objects. For details on the respective workflows when using these different objects, seePortfolio Object Workflow,PortfolioCVaR Object Workflow, andPortfolioMAD Object Workflow.
sets up proportional transaction costs for portfolio objects with additional options specified forobj
= setCosts(obj
,BuyCost
,SellCost
,InitPort
,NumAssets
)SellCost
,InitPort
, andNumAssets
.
Given proportional transaction costs and an initial portfolio in the variablesBuyCost
,SellCost
, andInitPort
, the transaction costs for any portfolioPort
reduce expected portfolio return by:
BuyCost' * max{0, Port - InitPort} + SellCost' * max{0, InitPort - Port}
Examples
Input Arguments
Output Arguments
Tips
You can also use dot notation to set up proportional transaction costs.
obj = obj.setCosts(BuyCost, SellCost, InitPort, NumAssets);
If
BuyCost
orSellCost
are input as empties with[]
, the corresponding attributes in the portfolio object are cleared and set to[]
. IfInitPort
is set to empty with[]
, it will only be cleared and set to[]
ifBuyCost
,SellCost
, andTurnover
are also empty. Otherwise, it is an error.
Version History
See Also
Topics
- Working with Transaction Costs
- Working with Transaction Costs
- Working with Transaction Costs
- Portfolio Analysis with Turnover Constraints
- Portfolio Optimization Examples
- Portfolio Set for Optimization Using Portfolio Objects
- Portfolio Set for Optimization Using PortfolioCVaR Object
- Portfolio Set for Optimization Using PortfolioMAD Object