Thursday, February 28, 2013

Monkey business



A few years ago it was suggested that monkeys can beat professional asset managers at picking stocks to invest in. Even though the result of the experiment conducted by the WSJ in 1988 was not conclusive, the idea disturbed the investment community a little.

But it seems some professional asset managers had found a creative way to take advantage of the random portfolio selection effect. If monkeys can - at least sometimes - beat professional at the game, why not to increase our chances by multiplying strategies / funds and boast success... in some of the funds under management!

There are usually two ways to make money in the asset management business: one can either take a share of the profits generated by the fund, or charge some annual management fee. Both of these fees have an asymmetric structure, beneficial to the manager - in the first case he gains when the fund increases in value, while he does not lose any serious money when the value of the fund collapses. The second fee is connected only with size of the fund / assets under management and not - at least directly - with its performance / value.

Hence, in many cases it is enough to amass a large enough asset pool and charge the fund participants / investors irrespective of fund results.

In order to draw investors you need  two things: some limited track record or apparently convincing investment story, and an extensive sales network. With that, you are ready to show your true investment incompetence without worrying about your income... :(

Since many fund managers have problems beating the market and sometimes can make terrible mistake, what is the difference between average fund manager and the monkey then? Monkeys seems fair.


Tuesday, February 19, 2013

Perfect time for testing peak detection models

An experimental peak detection model I've been working recently strengthens the signals generated by other methods - FTSE is a sell.

Fig. Experimental Peak Detection Model - FTSE, 2013-02-18

A few days ago I wrote about my implementation of TD Sequential indicator. The indicator was (prematurely) screaming sell FTSE for a couple of months and for a dozen or so percentages. I stressed that I was not sure about the soundness of the method nor correctness of my implementation, but the TD Sequential signals coincided quite well with readings I was getting from Extremum Detection System (EDS).

A major shortcoming of EDS was the asymmetry in detecting peaks and troughs. I've been working on that issue for some time, and even that I'm not sure yet about the results yet, I present here a novel peak detection method which I currently investigate.

It seems that we are now in a perfect moment for testing peak detection methods.. Most other peak detection tools I know are confused by the current market behavior. Also, even if we cannot use trend following methods for predicting future - they were not designed for that - we can use them as trend health measures. And they tell the market will continue trending up.

What will prevail?


Sunday, February 17, 2013

Screeming sell on FTSE or...?

During the weekend, I've started playing with TD Sequential Indicator developed by Tom DeMark.

There are mixed opinions about it - some people highly recommend it, while the others consider it pure voodo (read comments under the article).

Frankly speaking I also have problems believing it may work at all. Why turning points must appear after exactly 9 consecutive price moves, every time? Why not 8 or 13 (13 is another magic number used for exhaustion sequence)? Should we consider daily, weekly or hourly price bars when calculating the indicator?

The idea of TD Sequential came from studying Fibonacci numbers. Initially two numbers were considered: 8 and 13. However after some experiments, DeMark chose a non-Fibbonacii number 9 for its indicator. There is no explanation for this decision. Actually Tom DeMark declared that he didn't know why his system may work. "Ask God." was his answer.

To put the TD Sequential to a little test I implement it in R. I'm aware that my implementation may not be fully accurate, for some aspects of the indicator were not clear in the reference materials I had used. I may also be wrongly interpreting the indicator (I mostly use the Setup sequence). Above all, a test conducted on a single asset and over one period is definitely not exhaustive.

OK, after I made a disclaimer, let's do some work.

In connection with the issue mentioned in my previous post, I selected the FTSE index of the London Stock Exchange as the subject of my experiment.

Fig. TD Sequential for FTSE, 2 years

TD Sequential more or less correctly identified four local troughs: in June 2011, September 2011, May 2012 and November 2012.

Meanwhile its record for predicting peaks is mixed to disappointing. Probably the best signal was given in September 2012. Three earlier signals - in January (x2) and February 2012 - were followed just by minor pull backs. It also missed  a substantial peak in mid 2011.

The real problems started in December 2012 when TD Sequential started screaming SELL! And it continues to do so till now - nearly +12% later (BTW: Tom's January prediction regarding the peak in S&P500 were incorrect so far - see links at the end of the post).

Still, its pretty amazing that TD Sequential was able to point out many of the local extremes. And the differences in detecting troughs and peaks does not surprises me. The Extremum Detection System I'm currently working on, still has the same problem - it is pretty good at marking troughs, but it often fails when dealing with overbought levels. Fortunately it conveniently informs about this asymmetry in fit levels:

Fig. Extremum Detection System
(under development)


Read more about the TD Sequenatial from Tom DeMark itself:
http://forex-strategies-revealed.com/files/pictures_strategies/downloads/TD_SEQUENTIAL.pdf

Some recent DeMark's predictions:




Saturday, February 16, 2013

Hunting ghosts of bifurcation in S&P500

Some two weeks ago I wrote about my bad feelings about S&P500.

Since then the index has risen by 1.44%, mostly thanks to a 1% jump on February 1st.

Maybe I'm just suborn but my bad feelings didn't go away... yet.

Through the previous month, S&P500 levitated between two other major indexes: British FTSE and German DAX:

Source: Stooq

In the coming week one of these directions - FTSE's positive momentum or DAX's negative - will most probably win.

In addition, S&P500 (together with DJIA)'s momentum has recently noticeably surpassed that of NASDAQ:

Source: Stooq

Therefore I have decided to take a closer look at the intraday structure of the S&P500 dynamics.

It is still impossible to find definitive answer there, but a number of very weak signals suggests S&P500 may have peaked last week:

  • in the last 3 days we can notice a negative drift with lower lows and peaks
  • the frequency of local extremes increased
  • the amplitudes of the down moves has been increasing
  • the volatility is slightly increasing


Friday, February 8, 2013

Transferring risk for fun and profit


Some people claim, financial markets are the zero-sum game.

While it is true for futures and option markets (derivative markets in general), the situation may be quite different for stock exchanges.

There are two main reasons for this difference:

First, not everywhere and not all equities are shortable (i.e. short sale is not available). For example, on the Warsaw Stock Exchange, shorting stocks is virtually not available for retail investors (some equity futures are available, though). In addition, even if shorting is possible, there may be a substantial difference in long and short positions. Therefore, the drop in stock prices doesn't necessarily mean that somebody is gaining or that the equal amount of money is earned by the holders of short positions.

Second, the value of a stock depends on marginal price changes. Hence large price changes on small volumes can immensely impact ones position without causing transfer of value between investors. The accounting value can be created from virtually nothing or destroyed. Imagine you buy 10,000 shares at $100, worth $1 million. Later there are 100 transactions with increasing prices, each with volume of 1 share. As a result, the price of your stock rises from $100 to - say - $200. Based on the marked value, your portfolio is worth $2 million now. But is there an adequate liquidity available to sell it at this level? More realistically you should weight your portfolio using available volume.

Zero-sum games are connected with closed systems. All transfers are conducted between the players of the game. However, one can "export" the consequences connected with the game to external parties using "latent" derivatives.

One kind of such a "latent" derivative is bank credit. An investor may ask bank (or a broker) for a credit using his stock as collateral. In such a situation, bank shares the risk of decrease in price of securities, while usually being excluded from the potential increase in their value. It is especially dangerous if the value of the portfolio is inflated on low volume transactions as shown above. Creditors usually discount equities to mitigate such a risk, but their valuation models may inadequately factor in tail risk.

Derivatives allow to transfer and potentially distribute risk. Sometimes the parties taking the risk may not be adequately qualified and often does not have all the information required to properly asses the situation (recall the situation with CDO and CDS).

Yes, there is always the price for taking the risk. However,  the transaction is occasionally skewed toward the party who knows the underlying (i.e. traded security) or even is able to influence it - by taking advantage of marginal pricing. In addition the face value of the derivative may be a multiple of the value of the base instrument, which makes price manipulation easier.

Friday, February 1, 2013

Matrix Revenge?

Is this a glimpse at Matrix Revenge? ;)

Prepared with: RStudio

Sometimes I get some peculiar results while working on quantitative investment models.

Hopefully they won't lead to outcomes like this (note "DOW -4,847"):


Still, one can imagine many strange things...

And even more strange things can really happen...

And the devil is in the very small details...

And I've recently had some bad feelings about the market...

Maybe it is just the winter...