[R-SIG-Finance] Analyze Many Trading Systems Against a Metric

Eduardo Henri-Levy edhenrilevi at gmail.com
Thu Jun 23 05:19:36 CEST 2011


Hi,

I'm a data analyst new to the world of quantiative finance. I have at my
access a large history of performance data for around 150,000 different
automated trading systems. I have minute by minute data starting from 2003
to present.

One of the first thing's I'm trying to do is compare the daily performance
data of a subset of a few hundred of the total number of systems to a
baseline metric, call it MetricX.

My question is twofold, the first part about being more math-centric and the
2nd part being R based.

1st part:

I want a measure of the relation between a system and MetricX.
What would your first step be to see which systems have any kind of
relationship with MetricX?

2nd part:
how would you perform the above analysis using R? Are there particular
libraries that would simplify this analysis?

As an example of what I'm trying to do, see the code and graphs below. The
red line is MetricX, and the four plots are different systems. I am looking
for a way to find which systems have the strongest relationship wiht
MetricX, and the ones that have the weakest relationship with MetricX.

Thanks in advance,
EHL

require(ggplot2)
require(plyr)
set.seed(786)
n <- 100
sys1 <- rnorm(n, mean=100, sd=10)
sys2 <- rnorm(n, mean=80, sd=50)
sys3 <- rnorm(n, mean=120, sd=10)
sys4 <- rnorm(n, mean=90, sd=5)
date <- seq(1, n)
metricX <-  50*(sin(0.1*date)) + 100
temp_df <- data.frame(sys1, sys2, sys3, sys4, date, metricX)
df <- melt(temp_df, id=c("date", "metricX"))
p <- ggplot(df, aes(x=date, y=value)) + geom_line() + facet_wrap("variable")
p <- p + geom_line(aes(x=date, y=metricX), colour="red", size=1.0)
p
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20110622/1575a1ac/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sys.png
Type: image/png
Size: 24200 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20110622/1575a1ac/attachment.png>


More information about the R-SIG-Finance mailing list