pfo_target_trade: Make a trade in portfolio to a target qty

Description Usage Arguments Value Examples

View source: R/pfofunc.R

Description

Make a trade in portfolio, given an instrument, its target final quantity and the price of the instrument in portfolio currency.

Usage

1
pfo_target_trade(pfo, instrument, target_qty, price)

Arguments

pfo

input portfolio.

instrument

financial instrument (string).

target_qty

target quantity (number).

price

price in portfolio currency (number).

Value

A portfolio.

Examples

1
2
3
4
p1 <- pfo_init('USD', 100000)
p2 <- pfo_trade(p1, 'MSCI', 10.5, 1756)
p3 <- pfo_trade(p2, 'MSCI', 12.5, 1789)
p4 <- pfo_trade(p3, 'MSCI', 0, 1793)

philaris/pfo documentation built on March 29, 2020, 7:58 p.m.