Description Usage Arguments Value Author(s) Examples
Computes monetary value of accumulated portfolio transactional costs.
1 | txn_costs(asset)
|
asset |
Portfolio or Position object created using portfolio_create( ) or position_add( ) function |
Metric object
Kostin Andrey <andrey.kostin@portfolioeffect.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
data(aapl.data)
data(goog.data)
data(spy.data)
portfolio=portfolio_create(priceDataIx=spy.data)
portfolio_settings(portfolio,windowLength = '3600s',resultsSamplingInterval='60s',txnCostFixed=100)
positionGOOG=position_add(portfolio,'GOOG',c(100,200),time=c(1412256601000,1412266600000),
priceData=goog.data)
positionAAPL=position_add(portfolio,'AAPL',c(300,150),time=c(1412266600000,1412276600000),
priceData=aapl.data)
result=compute(txn_costs(portfolio),txn_costs(positionGOOG),txn_costs(positionAAPL))
plot(txn_costs(portfolio),txn_costs(positionGOOG),txn_costs(positionAAPL),
legend=c('Portfolio','GOOG','AAPL'),title='Transactional Costs')
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.