Skip to content

Instantly share code, notes, and snippets.

@tota
Last active October 5, 2015 18:38
Show Gist options
  • Save tota/2856137 to your computer and use it in GitHub Desktop.
Save tota/2856137 to your computer and use it in GitHub Desktop.
library(RFinanceYJ)
library(quantmod)
aud <- as.xts(read.zoo(quoteFXTsData('AUDJPY=X', '2010-01-01')))
close <- aud[,4]
sma <- SMA(close,60)
names(sma) <- c('SMA(60)')
dfma <- (close - sma)*100/sma
names(dfma) <- c('DFMA(60)')
tail(dfma)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment