Instantly share code, notes, and snippets.

View R_Return_Calc.R
# First, we need to download some data. This can be done in R, but usually we can just do it
# manually, e.g. from Yahoo Finance. I like Goldman Sachs, so I downloaded historical prices
# from 1 Jan 2012 to 1 Jan 2013 and saved it in my local folder as 'gs_raw.csv'
# * Reads a .csv file
# First make sure the current working directory is your local folder:
# Now read in the data and save it in a data.frame 'gs.df'
# QSTK Imports
import QSTK.qstkutil.qsdateutil as du
import QSTK.qstkutil.tsutil as tsu
import QSTK.qstkutil.DataAccess as da
# Third Party Imports
import datetime as dt
import matplotlib.pyplot as plt
import pandas as pd