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
# ABOUT: | |
# A script that grabs a list of the friends or followers of a user on Google+, | |
# grabs a sample of their friends, and generates the resulting social graph | |
# USAGE: | |
# Requirements: networkx (see DEPENDENCIES) | |
# Configuration: see CONFIGURATION | |
# Output: files will be save to the reports directory | |
# To run the script: | |
# 1) Download this file to a new directory somewhere as eg gplusESPnet.py |
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
#obviousness of reits? | |
#get NAREIT data | |
#I like NAREIT since I get back to 1971 | |
#much easier though to get Wilshire REIT from FRED | |
#also it is daily instead of monthly | |
#getSymbols("WILLREITIND",src="FRED") will do this | |
require(gdata) | |
reitURL <- "http://returns.reit.com/returns/MonthlyHistoricalReturns.xls" | |
reitExcel <- read.xls(reitURL,sheet="Index Data",pattern="All REITs",stringsAsFactors=FALSE) |
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
doInstall <- TRUE | |
toInstall <- c("XML") | |
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")} | |
lapply(toInstall, library, character.only = TRUE) | |
myURL <- "http://en.wikipedia.org/wiki/United_States_presidential_election,_2012" | |
allTables <- readHTMLTable(myURL) | |
str(allTables) # Look at the allTables object to find the specific table we want | |
stateTable <- allTables[[14]] # We want the 14th table in the list (maybe 13th?) |
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
doInstall <- TRUE | |
toInstall <- c("zoo") | |
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")} | |
lapply(toInstall, library, character.only = TRUE) | |
ftseIndex <- EuStockMarkets[, 4] | |
plot(ftseIndex, col = "GRAY") | |
# Calculate 10-day rolling mean, quickly: | |
smoothIndex <- rollmean(x = ftseIndex, # original series |
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
doInstall <- TRUE | |
toInstall <- c("zoo") | |
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")} | |
lapply(toInstall, library, character.only = TRUE) | |
ftseIndex <- EuStockMarkets[, 4] | |
plot(ftseIndex, col = "GRAY") | |
# Calculate 10-day rolling mean, quickly: | |
smoothIndex <- rollmean(x = ftseIndex, # original series |
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
# load requisite libraries | |
library(shiny) | |
library(googleVis) | |
# load raw data (NB not provided) | |
tableByGame <- read.csv("../tableByGame.csv",stringsAsFactors=FALSE) | |
# to create chart need to repeat one column and get negative of league position as hack | |
tableByGame$game <- tableByGame$seasonGame | |
tableByGame$lgPos <- -tableByGame$lgPos |
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
############################################################################### | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
# GNU General Public License for more details. |
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
############################################################ | |
## Using Genetic Algorithms in Quantitative Trading | |
## | |
## thertrader@gmail.com - Mar 2014 | |
############################################################ | |
library(PerformanceAnalytics) | |
library(rgenoud) | |
library(quantmod) | |
library(TTR) |
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
#-*- coding: utf-8 -*- | |
import codecs | |
import time | |
import json | |
import re | |
import sys | |
from selenium import webdriver | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer