This is a guide on how to use stockFunctions package

This package is intendent to simpify turning daily stock ticker open high low close volume data into a a matrix for machine learning. The objective is essentailly to predict simulataniouslly a group of stocks.

get Historical stocks takes a list of stock tickers and saves them as xts objects in an Enviroment

library(stockTools)
if(!exists('E'))E<-new.env()
getHistoricalStocks(c('GE',  "AA" ), e = E , startDate = '2000-01-01', endDate = '2017-08-01')
eapply(E, function(x)tail(x,1))

tickerEnvUpdate takes an enviroment with xts stock data, and updates each object with the latest data

tickerEnvUpdate(E)
eapply(E, function(x)tail(x,1))

buildStockDataSetFromEnv takes an enviroment with xts stock ticker data stored in it and merges it together in one data frame. It also uses functions from myfeatures.r ( a wrapper for the TTR package) to do feature engineering.

## working here
ls(E)
head(E$AA)
x<-buildStockDataSetFromEnv(E)
dim(x)
tail(x,2)


mdavis29/stockFunctions documentation built on May 22, 2019, 3:22 p.m.