This file contains 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
# Code for obtaining annual reports and computing similarity measures | |
# Used for: https://craha.wordpress.com/2018/05/21/an-implementation-of-lazy-prices/ | |
library(edgarWebR) | |
library(dplyr) | |
#library(parallel) - I used mclapply instead of lapply below to speed things up when running more stocks | |
library(text2vec) | |
library(stringr) | |
stock_list <- c("MMM", "AXP", "AAPL", "CAT") | |
#this may take a while, many html requests. |
This file contains 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
#Performance of a NASCAR portfolio, where weights and stocks are determined by positioning of winners and their sponsors | |
# https://craha.wordpress.com/2018/04/24/the-nascar-investment-strategy/ | |
library(rvest) | |
library(tidyverse) | |
library(XML) | |
library(tidyquant) | |
library(plyr) | |
library(alphavantager) | |
#Starting URL |