All pastes #2051334 Raw Edit

Miscellany

public text v1 · immutable
#2051334 ·published 2011-04-27 21:27 UTC
rendered paste body
require(quantmod)
y <- getFX('USD/CAD', from=Sys.Date()-499, auto.assign=F)
y.above <- y[as.vector(y) > mean(as.vector(y))]
y.below <- y[as.vector(y) < mean(as.vector(y))]
plot(y, type='n')
polygon(y.below, col='green')
polygon(y.above, col='red')