-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
48 lines (35 loc) · 1.04 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
title: "README"
author: "Bruce C. Schardt"
date: "4/16/2019"
output: md_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## avR Package
A simple client to access the Alpha Vantage Market Data Api. Only the TIME_SERIES_DAILY_ADJUSTED and TIME_SERIES_INTRADAY endpoints are exposed.
```{r echo=FALSE, message=FALSE, warning=FALSE}
library(avR)
library(tidyquant)
```
## Daily Market Data
```{r}
aapl <- time_series_daily_adjusted("AAPL",from = "2019-01-01", to = "2019-06-01")
aapl
```
## Intraday Market Data
```{r}
aapl_id <- time_series_intraday("AAPL",nDays = 1)
aapl_id
```
Note that the data is returned as a tibble (dataframe)
```{r apple daily}
ggplot2::ggplot(aapl ,aes(x = datetime)) +
geom_candlestick(aes(open = aOpen, high=aHigh, low= aLow, close = aClose)) + ggplot2::ggtitle("APPLE DAILY",subtitle = "from ALPHA VANTAGE")
```
```{r apple intraday}
ggplot2::ggplot(aapl_id ,aes(x = minute,y=close,colour=date)) +
geom_line() +
ggplot2::ggtitle("APPLE Intraday",subtitle = "from ALPHA VANTAGE")
```