plot.return | R Documentation |
Plot a time series of the return of a given stock.
## S3 method for class 'return' plot(ticker, from, to, time = "days")
ticker |
A single character variable storing the ticker of the stock to be downloaded. Note that since data are downloaded from Yahoo finance, the ticker should be the same as the ones reported on Yahoo finance. See examples. |
from |
A single character variable storing the starting date from which we want to download the data. The format should be "yyyy-mm-dd" |
to |
A single character variable storing the ending date from which we want to download the data. The format should be "yyyy-mm-dd" |
time |
A single character variable which indicate the desired time frame of the returns. Should be one among the following: "days" ; "weeks" ; "months" ; "quarters" ; "years". Default to "days" |
## Not run: plot.return( "AAPL" ,"2016-01-01" ,"2022-01-01" , time = "quarters") ##if you want to store a dataset in the envinroment AAPL_ret <- plot.return( "AAPL" ,"2016-01-01" ,"2022-01-01" , time = "quarters") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.