Monday, December 31, 2012

Year 2012 in review and a new hope

The beginning of winter is usually quite depressing. And the end of the year invites some recollections.

Source: Flickr

This was a really busy year, mostly devoid of any pleasures.

Source: Flickr

There was no much time for rest either...

Source: Flickr

Some pretty complex ideas emerged from intensive research, heavy head banging and crazy brain storming.

Prepared with Wordle

But there is a great hope for 2013! And the outlook is promising :)

Source: Flickr

Tuesday, December 25, 2012

WIG is 20%+ up YTD... mostly thanks to overnight gaps

The end of the year is near.

In the previous (nearly) 24 months, the broadest index of the Warsaw Stock Exchange - WIG - has gained more than 20%:

Fig. WIG performance YTD till 2012-12-21; source:

This noticeable result has been generated thanks to a pretty small positive drift in daily returns - less than 0.1%:

Fig. WIG daily returns in 2012

But what's more interesting, a major part of this year's growth is a result of overnight WIG changes - i.e. gaps between previous day close and the following day's open:

Fig. WIG open-close and close-close daily returns

Meanwhile, while the 20%+ WIG's return is quite impressive, it is quite distant from the theoretical maximum gain possible to be realized with perfect prior knowledge.

Fig. Maximum theoretical WIG gain at 1H frequency.

Saturday, December 22, 2012

Eurogeddon - or how NOT to play Black Swans

Risky bet against ECB

In February this year a new fund aiming at the collapse of the EU was launched. The founders of the fund called Eurogeddon claimed 150%+ returns if the assumed scenario comes true.

After some 9 months, the actual fund performance is totally different from what was promised. The fund is 36,4% down since February 22, 2012. And chances of recovering from this drawdown are remote.

Fig. Eurogeddon performance February-December 2012; source:

I don't intend to discuss whether the investment theme (i.e. collapse of the EU) was right or not. Also, I do not plan to dispute the idea of launching a fund targeting ECB's unwillingness to support the Eurozone in critical situation.

As George Soros demonstrated in 1992 it is possible to successfully bet against a major central bank, but only if you are on the right side of the trade...

Eurogeddon design flaws

Instead I would like to focus on two key design flaws in construction of Eurogeddon.

1. using futures instead of options and CDS

Eurogeddon strategy was implemented mostly through purchases of symmetric futures contracts - index futures, currency futures and bond futures. Hence, the fund was (and still is) fully exposed to developments contrary to its assumed scenario.

Nassim Taleb, the person who coined the term Black Swan, recommended Black Swan-type strategies to be implemented using a portfolio consisting of mostly secure bonds, supplemented by a small portion allocated in out-of-the money options adequate to a given low probability scenario (or scenarios... - see next point).

Taleb's recommended implementation significantly reduces the risk of a adverse scenario development for potential loses are limited to premiums paid for the options. In addition, some of the premium should be covered by interest paid by the bonds.

2. reliance on a single low probability potential event

In addition, unlike typical Black Swan funds, like Universa or Pine River, Eurogeddon bet everything on a single scenario. Hence, if such assumed scenario does not materialize, Eurogeddon had nothing else it could benefit from. 

Most low probability high impact funds try to play numerous different scenarios. Sometimes they bet on contrary large developments in one particular area (i.e. possibility of huge decrease or huge increase in a price of some asset). They do not know which scenario will come true. They just want some of them to materialize over time.

There is a need for Black Swan type funds, but Eurogeddon is simply an inadequate vehicle.

I'm convinced there is a need for more Black Swan type funds. Unfortunately the construction proposed by the founders of Eurogeddon is incorrect.

Yes, there was a slight chance that the fund may bring substantial gains if the single scenario on which the fund was based comes true.

But the expected return based on the probability of the event and risk connected with the selected implementation employing symmetric instrument was too low. Even negative :(

I hope, the Eurogeddon story will not discourage people from Black Swan type funds. And I wish somebody launches a new better designed fund of this type.


Eurogeddon - offical results

Eurogeddon - peformance at

Friday, December 21, 2012

Raising volatility before turning points?

For many people this may be quite obvious, but often volatility raises before local extremes (such as turning points).

This may serve as either the signal to close existing position or open the new position opposite to the current trend.

But of course, this is not always this simple :)

Fig. FW20 and volatility

BTW: The currently increased FW20 volatility may signal that some local extremum, or even a turning point, may be close for the main index of the Warsaw Stock Exchange.

Nevertheless, the mid term outlook for the market seems pretty bright as based on the volume-price analysis presented yesterday.

Thursday, December 20, 2012

When price action follows volume changes

Have you noticed the recent correlation between WIG20's (the key index of the Warsaw Stock Exchange) average volume and its value?

Seems that after the huge volume collapse since 2009, the trading in stocks constituting the WIG20 index has been gradually increasing for about a year.

What's interesting, this growth is accompanied by earlier stabilization and currently gradual increase in the value of WIG20:
Fig. WIG20 - average volume (n=252) and price

Meanwhile, the recovery in trading in WIG20 does not correspond with similar action in FW20 (WIG20 futures) volume.

Strangely, its quite the opposite. While average WIG20 volume raises, FW20 volume continues to fall:
Fig. WIG20 and FW20 average volume

The correlation between WIG20 and FW20 volumes seems broken.

Fig. WIG20 and FW20 volume details

Nevertheless, based on the observed WIG20 volume action, it is possible that we currently entering a longer period of stabilization or growth.

However, it is likely that the Warsaw market may face some correction in the short term - see the next post about volatility and turning points.

Beating market with technical analysis... by pure chance

Many people believe in power of technical analysis. Plenty of trading strategies are based on signals generated by technical indicators.

Much fewer people are trying to verify the quality of these indicators, though.

While working on some prediction models I have decided to put some of these technical indicators to the test.

First I would like to see, how these indicators are correlated among each other:

Fig. Cluster Dendogram for selected Technical Indicators

One can clearly see that some indicators - like RSI and CCI for example - are pretty close to each other.

Nevertheless none of the indicators were found to be correlated 0.95 or more to any other (note: the methodology for checking correlations between indicators was a little different than the one used for constructing the dendrogram)

Knowing something about the connections between the indicators is one thing. The totally different story is to verify their predictive power in relation to returns.

Here we can once more start with correlation:

     [,1]       [,2]        [,3]              [,4]         [,5]           [,6]             [,7]           [,8]            
[1,] "x.skew25" "x.trend25" "x.HH_LL.25.High" "x.change25" "x.up.ratio25" "x.MACD.12.26.9" "x.Ultimate.7" "x.kpss.level25"
[2,] "0.23541"  "0.22487"   "0.20162"         "0.18177"    "0.16651"      "0.16404"        "0.14708"      "0.14135"       

     [,9]      [,10]      [,11]      [,12]      [,13]       [,14]       [,15]            [,16]           [,17]    
[1,] "x.sd25"  "x.CCI.20" "x.ADX.14" "x.RSI.14" "x.OBV.252" "x.DVI.252" "x.kpss.trend25" "x.scaleTau225" "x.adf25"
[2,] "0.12177" "0.12023"  "0.11260"  "0.10858"  "0.10350"   "0.09826"   "0.09149"        "0.06537"       "0.05890"

[1,] "x.hurst25"
[2,] "0.03247"  

As you can see, correlation coefficient rarely reaches 0.2.

Additionally, we can use RELIEF algorithm, that should help us identify non-linear relations in our model:

RELIEF: 0.2 
         x.sd25 x.HH_LL.25.High       x.OBV.252   x.scaleTau225  x.MACD.12.26.9        x.ADX.14      x.change25 
    0.194510019     0.193041550     0.189254007     0.168264622     0.137401102     0.125753731     0.083702019 
   x.up.ratio25       x.hurst25        x.skew25        x.RSI.14       x.DVI.252       x.trend25  x.kpss.level25 
    0.071718162     0.069785953     0.062099966     0.053276906     0.042572825     0.028786406     0.018634994 
 x.kpss.trend25    x.Ultimate.7         x.adf25        x.CCI.20 
    0.018233187     0.011072828     0.009101300     0.003876559 

Unfortunately, RELIEF seems to confirm the low correlation scores we got in the previous step :(

We can also try to combine some of our features (i.e. technical indicators in this case), using PCA:

Fig. PCA components for selected technical indicators

However, while ordinary PCA gives us some hopes for increasing the predictive value of the features we use here, the much powerful Kernel PCA is not so promising:

Fig. Kernel PCA for selected technical indicators

While the predictive power of technical indicators (at least as used in this analysis) seems to be virtually non-existent, it is not impossible to beat the market using it. Occasionally...

Fig. Some AT-based model realization
(market=+0.9%; strategy=+6.3%)