View source: R/chart.Reconcile.R
chart.Reconcile | R Documentation |
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.
chart.Reconcile(
theoPort,
actualPort,
Symbol,
Dates = NULL,
...,
PLdiff = c("cumulative", "episodic"),
data = c(FALSE, "View", "return")
)
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 |
... |
any other passthru parameters to |
PLdiff |
one of 'cumulative' or 'episodic', see Details. |
data |
what to do with the calculated data, see 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)
Expect changes to this function, since the underlying charts are experimental functions in quantmod.
chart.Posn
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.