plot: Plot of a 'Strategy'-object

Description Usage Arguments Examples

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:

Usage

1
2
3
4
## 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 Strategy.

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 NULL will return all filters from the strategy.

which.indicators

Which indicators shall be added to indicator plot. Default value NULL will return all filters from the strategy. If "none", no indicator is plotted and indicator area is not shown.

main

The main title of the plot.

show.signals

If TRUE, the trading signals are shown within the indicators area of the plot. Default value is TRUE.

include.costs

If FALSE, the fixed and relative trading costs are NOT considered for performance calculation. Default value is TRUE. As default values for costs are 0, this argument is redundant if no costs are given.

...

Further arguments passed to custom plotFUN (if available) of the object (x).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
##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)

Example output



Strategy documentation built on May 2, 2019, 2:09 a.m.