Description Usage Arguments Value Examples
Compute trades between a start and a target pfo.
1 | diff_trades(from, to, dt, val_pri.e)
|
from |
initial portfolio. |
to |
target portfolio. |
dt |
date. |
val_pri.e |
price values environment. |
A list of trades.
1 2 3 4 5 6 7 8 9 10 11 | p1 <- pfo_init('USD', 100000)
p2 <- pfo_trade(p1, 'MSCI', 10.5, 1756)
p3 <- pfo_trade(p2, 'VIX', 20, 14)
from <- pfo_grepl(p1, 'MSCI|VIX')
to <- pfo_grepl(p3, 'MSCI|VIX')
dt <- as.Date('2019-05-22')
xts_msci <- xts::xts(1756, order.by = dt)
xts_vix <- xts::xts(14, order.by = dt)
val_pri.l <- list('MSCI' = xts_msci, 'VIX' = xts_vix)
val_pri.e <- list2env(val_pri.l)
diff_trades(from, to, dt, val_pri.e)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.