# Use Trades as Input for PerformanceAnalytics

I'd like to use the PerformanceAnalytics R package to view various metrics from a list of trades with profit values. From looking at the documentation from the PerformanceAnalytics package that most functions are set up to use a time series of prices rather than an array of profit values (which of course can be negative).

Can PerformanceAnalytics be used on an array of profit values (from a backtest that might have several instruments in it for example)? If not, is there a way to convert the profit values to a format that makes sense to input into most PerformanceAnalytics functions?

-

If you've got a list of trades, I would first suggest using the blotter package to enter those transactions and compute your cash P&L. Then you can use the tradeStats function to see trade related statistics, or the portfReturns function to extract percent returns for your portfolio of symbols as a contribution to total account equity returns. After calling portfReturns, all the functions in PerformanceAnalytics will have the inputs that they expect.