Skip to content

Instantly share code, notes, and snippets.

@craha22
craha22 / lazy_prices_implementation.R
Created May 23, 2018 18:30
Code to accompany Lazy Prices blog post
# 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.
@craha22
craha22 / nascar_stock_port.R
Last active April 24, 2018 18:00
Quick experiment of a NASCAR driven investment strategy
#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