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
hello milktrader! |
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
library(quantmod) | |
library(PerformanceAnalytics) | |
getSymbols('HEIA.AS', src='yahoo') | |
Return.cumulative(Return.calculate(get('HEIA.AS')['2010-12-31::'])) |
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
#!/usr/bin/ruby | |
def winloss | |
if rand(2) == 1 | |
return true | |
else | |
return false | |
end | |
end |
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
#!/usr/bin/ruby | |
def winloss | |
if rand(2) == 1 | |
return true | |
else | |
return false | |
end | |
end |
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
require 'rubygems' | |
require 'eventmachine' | |
require 'em-http-request' | |
require 'json' | |
EventMachine.run { | |
bid = 0.0 | |
ask = 0.0 | |
spread = 0.0 |
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
data <- read.table('TrAEX.xls', header=TRUE, sep='\t', skip=5, stringsAsFactors=FALSE) | |
data.xts <- xts(data$Quote, order.by=as.POSIXlt(data$Date...time, format='%H:%M:%S')) |
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
require(quantstrat) | |
# clean up | |
rm(list=ls(all=TRUE, pos=.blotter), pos=.blotter) | |
rm(list=ls(all=TRUE, pos=.instrument), pos=.instrument) | |
rm(list=ls(all=TRUE, pos=.strategy), pos=.strategy) | |
# set initial values | |
initDate <- '2011-08-05 06:00:00' | |
initEq <- 10000 |
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
djbutton = $($('a').get(0)); | |
var djit = function() { | |
if (djbutton.css('display') != 'none') { | |
e = new jQuery.Event('click'); | |
e.pageX=1; | |
e.pageY=1; | |
turntable.lastMotionTime=new Date().getTime(); | |
djbutton.hover().trigger(e); | |
console.log(new Date() + ' -- triggered DJ'); | |
} else { |
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
require(xts) | |
data(sample_matrix) | |
dates <- as.POSIXct(rownames(sample_matrix), format = "%Y-%m-%d") | |
dayLookup <- 1:7 | |
names(dayLookup) <- c("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun") | |
datesDays <- dayLookup[weekdays(dates, abbreviate = TRUE)] | |
print(datesDays) | |
blah <- xts(cbind(sample_matrix, dow =datesDays), order.by = dates) | |
blah[blah$dow!=5] |
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
cat('hi\n') | |
read.csv(file('stdin'), header=FALSE) | |
print(information) | |
cat('hi again\n') |
OlderNewer