Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ##################################################################################### | |
| # Strategy - Shorting at High # | |
| ##################################################################################### | |
| # Upload the libraries and make other initial settings ########################################################################################## | |
| library(xlsx);library(zoo);library(quantmod);library(rowr);library(TTR); | |
| system.time({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Download Data Using Alphavantage | |
| using HTTP | |
| res = HTTP.get("https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=AAPL&interval=1min&apikey=your_api_key&datatype=csv") | |
| mycsv = readcsv(res.body) | |
| x = convert(DataFrame, mycsv) | |
| x = x[2:nrow(x),:] # subset remove header row | |
| # Rename Columns | |
| colnames = ["Date","Open","High","Low","Close","Volume"] | |
| names!(x.colindex, map(parse, colnames)) | |
| # Convert String Date to Date format |