londonr 18 th september 2012
Download
Skip this Video
Download Presentation
LondonR 18 th September 2012

Loading in 2 Seconds...

play fullscreen
1 / 8

LondonR 18 th September 2012 - PowerPoint PPT Presentation


  • 116 Views
  • Uploaded on

LondonR 18 th September 2012. SPONSORED BY. R TRAINING, CONSULTING & APPLICATION DEVELOPMENT. From Back-test to Trade using R Parallelization in OneTick. [email protected] [email protected] What the presentation shows. EURJPY FX tick data

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' LondonR 18 th September 2012' - lotta


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
londonr 18 th september 2012

LondonR18th September 2012

SPONSORED BY

R TRAINING, CONSULTING & APPLICATION DEVELOPMENT

what the presentation shows
What the presentation shows
  • EURJPY FX tick data
  • Take a small section of historic tick data
  • Look at rugarch analyses
  • Ability to use parallelisation effectively
  • How?
      • 5 minute architectural overview of OneTick
      • Questions around tick data management
  • Q & A?
deal with idiosyncrasies of tick data
Deal with idiosyncrasies of tick data

> setClass("TK", representation="POSIXct")

> TK <- function(x)new("TK", as.POSIXct(x, format="%Y%m%d %H:%M:%OS"))

> setOldClass("TK", S4Class="TK", where=.GlobalEnv)

>

> as.TK <- function(from)TK(as.POSIXct(from, format="%Y%m%d %H:%M:%OS", tz="GMT"))

> setAs("character", "TK", as.TK)

> setAs("TK", "POSIXct", function(from)as.POSIXct(as.numeric(from), origin="1970-01-01", tz="GMT"))

[1] "coerce<-"

> as.TK <- function(from)TK(as.POSIXct(from, format="%Y%m%d %H:%M:%OS", tz="GMT"))

> setAs("character", "TK", as.TK)

> setAs("TK", "POSIXct", function(from)as.POSIXct(as.numeric(from), origin="1970-01-01", tz="GMT"))

[1] "coerce<-"

> print.TK <- function(x, ...)print(format(as(x,"POSIXct"), format="%Y%m%d %H:%M:%OS3",...))

> setGeneric("print.TK", print.TK)

[1] "print.TK"

> setMethod("show", signature(object="TK"), function(object)print(format(object, format="%Y%m%d %H:%M:%OS3")))

[1] "show"

perform arbitrarily garch
perform (arbitrarily) garch

####### require(rugarch)

spec = ugarchspec()

## Assume that the points are distributed

fit = ugarchfit(data = diff(EURJPY[select,3]), spec = spec)

plot(fit,which="all")

# return just to the rate data

fit = ugarchfit(data = EURJPY[select,3], spec = spec)

plot(fit,which="all")

forc = ugarchforecast(fit, n.ahead=20)

plot(forc, which="all")

look for rolling values
Look for rolling values

ctrl = list(rho = 1, delta = 1e-9, outer.iter = 100, tol = 1e-7)

spec = ugarchspec(variance.model = list(model = "eGARCH"),

distribution.model = "jsu")

bktest <- ugarchroll(spec, data = EURJPY[select,3], n.ahead = 1,

# parallel = TRUE, parallel.control = list(pkg = c("snowfall"), cores = 4),

forecast.length = 100, refit.every = 25, refit.window = "recursive",

solver = "solnp", fit.control = list(), solver.control = ctrl,

calculate.VaR = TRUE, VaR.alpha = c(0.01, 0.025, 0.05))

plot(bktest, which="all")

look for rolling values1
Look for rolling values

## BID=BID_PRICE,ASK=ASK_PRICE

len<- length(BID)

mu=NA

alpha1=NA

bktest <- NA

if(len>110){

tryCatch({bktest <- ugarchroll(spec, data = BID, n.ahead = 1,

forecast.length = 100, refit.every = 25, refit.window = "recursive",

parallel = TRUE,

parallel.control = list(pkg = "snowfall", cores = 4),

solver = "solnp", fit.control = list(), solver.control = ctrl,

calculate.VaR = TRUE, VaR.alpha = c(0.01, 0.025, 0.05))

[email protected]["coefs"][[1]][1,"mu"]

[email protected]["coefs"][[1]][1,"alpha1"]}, error=function(e)cat("Error\n"))

}

## OneTick outputs

## MU=mu,ALPHA1=alpha1, LEN=len

ad