Blog Archives

Plotting git statistics

July 13, 2011
By
Plotting git statistics

Here’s a funny story – friend of my, avid gamer at that time, was going downhill on a bicycle when wonderful idea flashed his mind: I need to save the current status… Just in case if I crash, I will start again from the top of the hill. If you are a developer (quantitative or

Read more »

Artificial intelligence in trading: k-means clustering

July 6, 2011
By
Artificial intelligence in trading: k-means clustering

There is many flavors of artificial intelligence (AI), however I want to show practical example of the cluster analysis. It is very applicable in finance. For example, one of stylized facts of volatility is, that it moves in clusters, meaning that today’s volatility will be more likely as yesterday’s volatility. To gauge these moves you

Read more »

timezone issue in R

May 14, 2011
By

While investigating Intraday patterns in FX returns and order flow paper I have faced the problem with timezone. I had 3 data sources with different timezones (GMT, CET, CEST). Most confusing thing was, that I didn’t know, how to deal with summer time. But why did I have the data with summer time in the first place?

Read more »

Transaction cost analysis and pre-trade analysis

April 20, 2011
By
Transaction cost analysis and pre-trade analysis

Transaction cost analysis (TCA) is the framework to achieve best execution in trading context. TCA can be split into three groups: pre-trade analysis, intraday analysis, and post-trade measurement. Pre-trade analysis allows us to get insight about the future volatility of the price, forecast intra-day and daily volumes, market impact. It evaluates all strategies and advises

Read more »

Book: ggplot2 by Hadley Wickham

April 4, 2011
By
Book: ggplot2 by Hadley Wickham

All my recent plots are built using ggplot2 package. I don’t know if my dear readers have noticed the difference, but from my point of view, ggplot2 allows to create nice looking and aesthetics plots. I was using this package before, but the real boost came after reading this book: ggplot2: Elegant Graphics for Data Analysis (Use R).

Read more »

Correlation network

March 22, 2011
By
Correlation network

I came up with an idea to draw correlation network to get a grasp about relationship between a list of stocks. An alternative way to show correlation matrix would be head map, which can have limitations with big matrices (>100). Unfortunately,  ggplot2 package doesn’t have a easy way to draw the networks, so I was left

Read more »

Tick data retrieval

January 31, 2011
By

I just published Java based code to pull tick data from Interactive Brokers. There are thousands tools to get tick data from IB, but I had one feature in mind. You can get maximum 50 quotes per second from Interactive Brokers (its IB limitation for TWS API) . Imagine a situation, when there is a

Read more »

Interesting volatility measurement, part 2

January 21, 2011
By
Interesting volatility measurement, part 2

A few weeks ago I have mentioned about an interesting volatility prediction. It is based on two periods of historical volatility (standard deviation). The remaining question was – does it really works? I could not give the answer, because I didn’t have VIX futures data at that time. Later on, I was contacted by Brian

Read more »

Seasonal pair trading

January 10, 2011
By
Seasonal pair trading

quanttrader.info is a good quantitative repository, where I found an idea about seasonal spreads play. The idea of seasonal pair trading differs from pairs trading in a way, that it doesn’t try to find deviation from the spread’s mean, but it looks at seasonal spread patterns. In some cases it is easier to find an

Read more »

High readings of VIX index during 2 days

December 28, 2010
By
High readings of VIX index during 2 days

During last two sessions (December 23th and 27th), VIX index posted returns (close to close) above 6 %. My question is – what return can we expect next day after such event? As you can see from the graph above, expected return is positive. During 1995-2010 were 53 such events and mean return was 1.02 %

Read more »