[R-SIG-Finance] Convert Daily PnL to Returns

Brian G. Peterson brian at braverock.com
Fri May 15 19:03:20 CEST 2009


Convert them to a wealth index. Add 1 to your first PnL number, and 
cumsum. This creates a fake "price series" that can then be turned into 
a return series for all the other analysis you need to do.

if 'PnL' is your data variable:

cumsum(PnL+1)

Regards,

- Brian

Subhrangshu Nandi wrote:
> I'm using R to optimize our portfolio. However, I do not have a return
> series, as required in most of the portfolio optimization packages. I have
> daily PnLs (regular profit/loss numbers) of several products. In order to be
> able to use PerformanceAnalytics or RMetrics, how should I about converting
> them to returns? Also, my objective of optimizing the portfolio is to
> maximize the return, constrained on some risk parameter like VAR/CVAR/etc
> and then decide how much to trade each product.
>
> Any headstart in solving this problem will be helpful.
>
> Thanks a lot,
> -Nandi
>
>   


-- 
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock



More information about the R-SIG-Finance mailing list