rtsplot.lines: Add lines to time series plot

View source: R/rtsplot.r

rtsplot.linesR Documentation

Add lines to time series plot

Description

Add lines to time series plot

Usage

rtsplot.lines(y, type = "l", col = graphics::par("col"), ...)

Arguments

y

xts object

type

line type, defaults to 'l', for more info see lines

col

color, defaults to par('col')

...

additional parameters to the lines

Value

nothing

Examples

y = rtsplot.fake.stock.data(1000)
symbol = 'SPY'
	
 # moving average
sma = TTR::SMA(y, 250)

 # plot
 layout(1)
 rtsplot(y, type = 'l', col='black')
 rtsplot.lines(sma, col='blue', lwd=1.5)
rtsplot.legend(c(symbol, 'SMA(250)'), 'black,blue', list(y,sma))


rtsplot documentation built on Sept. 24, 2023, 1:07 a.m.