Posts tagged with finance

There is a central notion in Time Series Econometrics, cointegration. Loosely it refers to finding the long run equilibrium of two non-stationary series. As the most know non-stationary series examples comes from finance, cointegration is nowadays a tool for traders (not a common one though!). They use it as the theory behind pairs trading (aka Statistical Arbitrage).

In the following lines we use a simple pairs trading technique, studying the ratio of the two price evolution series. We use the New York versions of two of the greatest players in ATHEX, NBG and OTE.

stock <- "NBG"
stock1 <- "OTE"
start.date <- "2003-10-20"
end.date <- Sys.Date()
quote <- paste("http://ichart.finance.yahoo.com/table.csv?s=",
 stock,
 "&a=", substr(start.date,6,7),
 "&b=", substr(start.date, 9, 10),
 "&c=", substr(start.date, 1,4),
 "&d=", substr(end.date,6,7),
 "&e=", substr(end.date, 9, 10),
 "&f=", substr(end.date, 1,4),
 "&g=d&ignore=.csv", sep="")
quote1 <- paste("http://ichart.finance.yahoo.com/table.csv?s=",
 stock1,
 "&a=", substr(start.date,6,7),
 "&b=", substr(start.date, 9, 10),
 "&c=", substr(start.date, 1,4),
 "&d=", substr(end.date,6,7),
 "&e=", substr(end.date, 9, 10),
 "&f=", substr(end.date, 1,4),
 "&g=d&ignore=.csv", sep="")
dataNBG.l <- read.csv(quote, as.is=TRUE)
dataOTE.l <- read.csv(quote1, as.is=TRUE)
X2=dataOTE.l[order(dataOTE.l$Date),];Y2=dataNBG.l[order(dataNBG.l$Date),]

Read the rest of this entry »

One of the greatest event on R is under way…

R / Finance 2010: Applied Finance with R
April 16 & 17, Chicago, IL, US

The second annual R / Finance conference for applied finance using R,
the premier free software system for statistical computation and graphics,
will be held this spring in Chicago, IL, USA on Friday April 16 and
Saturday April 17.

Building on the success of the inaugural R / Finance 2009 event, this
two-day conference will cover topics as diverse as portfolio theory,
time-series analysis, as well as advanced risk tools, high-performance
computing, and econometrics. All will be discussed within the context of
using R as a primary tool for financial risk management and trading. Read the rest of this entry »

Real Time Web Analytics