View source: R/genericStrategy.R
plotPnL.Strategy | R Documentation |
Plot change of profit and loss through backtest period
## S3 method for class 'Strategy' plotPnL( this, comOn = TRUE, leg = "all", graph_type = "ggplot2", each_year = FALSE, adjust = FALSE, return_type = "plot", cutoff = FALSE, start, end )
this |
Strategy |
comOn |
bool, if true then commission will be included in the 'trades' graph |
leg |
numeric/character, number or numbers of legs, if it is equal to 'all' or 'sum', then all pnl among all legs will be summed, if it is equal to 'sep', then pnl among legs will be plotted |
graph_type |
character, ggplot2 / xts / plotly |
each_year |
logical, if TRUE, then each graph will start with 0 each year |
adjust |
logical, if TRUE, then values will be divided by getMoney(this) |
return_type |
character, plot or data |
cutoff |
logical, if true then vertical line will plotted on graph where model was created |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.