rtsplot.lines | R Documentation |
Add lines to time series plot
rtsplot.lines(y, type = "l", col = graphics::par("col"), ...)
y |
|
type |
line type, defaults to 'l', for more info see |
col |
color, defaults to par('col') |
... |
additional parameters to the |
nothing
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.