Description Usage Arguments Value Author(s) Examples
Sets new position quantity.
1 | set_quantity(asset,quantity)
|
asset |
Position object created using position_add( ) function |
quantity |
One dimensional vector of position quantities or an integer number if quantity is constant |
Void
Kostin Andrey <andrey.kostin@portfolioeffect.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
data(aapl.data)
data(goog.data)
data(spy.data)
portfolio=portfolio_create(priceDataIx=spy.data)
portfolio_settings(portfolio,windowLength = '3600s',resultsSamplingInterval='60s')
positionGOOG=position_add(portfolio,'GOOG',100,priceData=goog.data)
positionAAPL=position_add(portfolio,'AAPL',300,priceData=aapl.data)
print(portfolio)
set_quantity(positionGOOG,400)
print(portfolio)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.