Chart trades against market data, position through time, and cumulative P\&L

Description

Produces a three or four-panel or chart of time series charts that contains prices and transactions in the top panel, the resulting position in the second, a cumulative profit-loss line chart in the third.

Usage

1
2
chart.Reconcile(theoPort, actualPort, Symbol, Dates = NULL, ...,
  PLdiff = c("cumulative", "episodic"), data = c(FALSE, "View", "return"))

Arguments

theoPort

string identifying the theoretical portfolio to chart

actualPort

string identifying the actual portfolio to chart

Symbol

string identifying the symbol to chart

Dates

xts ISO 8601 style subsetting

PLdiff

one of 'cumulative' or 'episodic', see Details.

data

what to do with the calculated data, see Details

...

any other passthru parameters to chart_Series

Details

The theoretical trades, positions, and P&L are plotted first, in the 'light' versions of the colors, and then the actual values are overplotted in the main color. If they agree completely, the theoretical values will not be visible. Differences will make themselves visible by misalignment of the symbols or lines.

The fourth panel is the difference in P&L between the theoretical and actual values, and could be considered 'slippage', which could be positive or negative. It is calculated by subtracting the theoretical P&L from the actual P&L. If parameter PLdiff is 'cumulative', then this panel will display the cumsum of difference between the theoretical and actual portfolios. If parameter PLdiff is 'episodic' it will display the differences in P&L

The data parameter allows the user to either View or return the data calculated inside the chart. Default FALSE (only chart)

Note

Expect changes to this function, since the underlying charts are experimental functions in quantmod.

See Also

chart.Posn

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.