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
white_bull <- function(ticker) { | |
require("quantmod") | |
x <- getSymbols(ticker, auto.assign=FALSE) | |
c <- x[,4] | |
c50 <- SMA(c, n=50) | |
c200 <- SMA(c, n=200) |
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
white_bull <- function(ticker) { | |
require("quantmod") | |
x <- getSymbols(ticker, auto.assign=FALSE) | |
c <- x[,4] | |
c50 <- SMA(c, n=50) | |
c200 <- SMA(c, n=200) | |
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
crazy <- function(sym1, sym2) { | |
require ("quantmod") | |
# FIRST get the objects (price series returns) correctly formatted | |
x <- getSymbols(sym1, auto.assign=FALSE) | |
y <- getSymbols(sym2, auto.assign=FALSE) | |
x <- Delt(x[,4]) |
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
delta_farce <- function(sym="SPY", expiry=22, pct=.03){ | |
require("quantmod") | |
ticker <- getSymbols(sym, auto.assign=FALSE) | |
ticker <- ticker[,4] | |
win <- 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
lemon_lime <- function(sym="SLV", expiry=24, pct=.1){ | |
require("quantmod") | |
ticker <- getSymbols(sym, auto.assign=FALSE) | |
ticker <- ticker[,4] | |
win <- 0 | |
lose <- 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
blueberry <- function(sym="SLV", file="~/Desktop/24_days_ago.png"){ | |
require("quantmod") | |
ticker <- getSymbols(sym, auto.assign=FALSE) | |
ticker <- merge(ticker[,4], lag(ticker[,4],24)) | |
ticker <- na.locf(ticker, na.rm=TRUE) |
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(quantmod) | |
require(vioplot) | |
getSymbols("GLD") | |
friend <- DonchianChannel( GLD[,c("GLD.High","GLD.Low")], n=20 ) | |
buddy <- DonchianChannel( GLD[,c("GLD.High","GLD.Low")], n=10 ) | |
pal <- DonchianChannel( GLD[,c("GLD.High","GLD.Low")], n=5 ) | |
posse <- merge(friend$mid, buddy$mid, pal$mid) |
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
gnat <- function(sym="GLD", fast=50, slow=200){ | |
require("quantmod") | |
x <- getSymbols(sym, auto.assign=FALSE) | |
x$fast <- SMA(Cl(x), n=fast) | |
x$slow <- SMA(Cl(x), n=slow) | |
x$signal <- Lag(ifelse (x$fast > x$slow, 1, -1)) | |
x <- na.omit(x) |
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
pulp <- function(sym){ | |
require("quantmod") | |
juice <- getSymbols(sym, auto.assign=FALSE) | |
juice$log_ret <- dailyReturn(Cl(juice), type="log") | |
assign(sym, juice, envir=.GlobalEnv) | |
} |
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
# install.packages("quantmod") | |
require("quantmod") | |
getSymbols("^GSPC;^VIX") | |
plot(VIX) | |
par(new=TRUE) | |
plot(GSPC) | |
axis(4) |
OlderNewer