plot {Strategy} | R Documentation |
Plot of a Strategy
-object
Description
Calls a generic plot
function that can plot the data of any Strategy
-object. If a plotFUN
-function is given within the object, this user-defined function will be used. The generic function plots 3 parts:
Price area Plots the asset price data and filters.
Indicator area Plots the indicators and trading signals.
Performance area Plots performance of the strategy.
Usage
## S3 method for class 'Strategy'
plot(x, y, from=NULL, until=NULL
, which.assets=NULL, which.filters=NULL, which.indicators=NULL
, main=NULL, show.signals=TRUE, include.costs=TRUE, ...)
Arguments
x |
An object of class |
y |
Standard plot argument that is not relevant for Strategy objects! |
from |
From date that chart is to be plotted. |
until |
Until date that chart is to be plotted. |
which.assets |
Which assets shall be plotted (each one will result in single plot) |
which.filters |
Which filters shall be added to price plot. Default value |
which.indicators |
Which indicators shall be added to indicator plot. Default value |
main |
The main title of the plot. |
show.signals |
If |
include.costs |
If |
... |
Further arguments passed to custom plotFUN (if available) of the object (x). |
Examples
##Not run:
# MA(200)-Strategy
params <- list(k=200)
myStrat.MA <- Strategy(assets=assets, strat="MA", strat.params=params)
# Plot first asset of MA(200)-Strategy
plot(myStrat.MA, from="2015-01-01", until="2015-12-31", which.assets=1)
##End(Not run)