Skip to contents

Plot stock price and corresponding 10 and 20 day moving average.

Usage

plot_ma_10_20days(stock_symbol)

Arguments

stock_symbol

Ticker symbol of the stock for which the plot is created such as "MSFT"

Value

A line chart showing price data and corresponding 10 and 20 day moving average line for a stock.

Examples

plot_ma_10_20days("MSFT")
#> Rows: 9299 Columns: 8
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> chr  (1): symbol
#> dbl  (6): open, high, low, close, volume, adjusted
#> date (1): date
#> 
#>  Use `spec()` to retrieve the full column specification for this data.
#>  Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> Rows: 9299 Columns: 8
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> chr  (1): symbol
#> dbl  (6): open, high, low, close, volume, adjusted
#> date (1): date
#> 
#>  Use `spec()` to retrieve the full column specification for this data.
#>  Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> Rows: 9299 Columns: 8
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> chr  (1): symbol
#> dbl  (6): open, high, low, close, volume, adjusted
#> date (1): date
#> 
#>  Use `spec()` to retrieve the full column specification for this data.
#>  Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> Joining, by = "date"
#> Joining, by = "date"