Learn R Programming

aqr (version 0.4)

generatePnlCurve: method to generate a pnl curve from a running position. bids, asks and running position must have the same length. Can compute the pnl from one price to the other, but only for one asset! Does not take time into account - if you need signal delays, lag all input data on your own.

Description

method to generate a pnl curve from a running position. bids, asks and running position must have the same length. Can compute the pnl from one price to the other, but only for one asset! Does not take time into account - if you need signal delays, lag all input data on your own.

Usage

generatePnlCurve(bidPrices, askPrices, runningPosition, messages = FALSE)

Arguments

bidPrices
an array of bid prices
askPrices
an array of ask prices
runningPosition
an array that contains a vector of the position
messages
specifies whether you want to have debug messages or not, defaults to FALSE

Value

This function returns a plain double array with pnl changes (uncumulated) and not an XTS series.