Description Usage Arguments Details Value Examples
Create return data per contract for each contrato
1 | get_contrato_returns(position, cumulative = FALSE)
|
position |
A position data.frame object assumed to be generated using |
cumulative |
A boolean indicated whether returns are cumulative or daily. Defaults to FALSE |
This function takes a position data.frame and uses it to compute the return of the contrato by taking the percent change
of each date's valuation and its previous valuation indicated by the column named tot
.
A xts
(time series) object indexed by the date and with each column representing the daily return of the contrato.
Returns are give in the form of valuation ratio (final_price/initial_price)
1 2 | pos <- get_position(c("2015-12-31", "2016-01-04", "2016-01-05"), contrato = c("25774", "25773"))
get_position_returns(pos)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.