# Detecting Excess Market Moves

Sometimes markets move too fast and too far. This article is all about a new method to detect excess market moves. A new indicator will be presented, which overcomes many of the downsides of traditional ones like RSI or Bollinger Bands.

## Overbought and Oversold Indicators

I am sure you are familiar with the traditional indicators RSI and Bollinger Bands. Legions of analysts have used them to detect excess market moves and market reversals. You might have used a RSI reading above 70 or below 30 or a market close outside of a 2 standard deviation Bollinger Band to do so. But these traditional indicators have a big downside: they are always calculated over a given period of time: 14-bar RSI, or 20-bar Bollinger Bands. You can surely adjust this setting to your market, but who tells you that e.g. a 17-bar calculation period is better than taking the last 14 or 20 bars into account? Going this way is a slippery road and you might fall down the cliffs of curve fitting.

classic excess indicators

## A new algorithm for excess detection

Bollinger Bands already has the key ingredient for a useful reversal detector: it measures the market move in standard deviations. But it does the measure only over a fixed interval setting, thus missing a lot of shorter or longer excess market moves.

To overcome this restriction and find all excess moves, I did me an indicator which searches for excess moves over multiple intervals. This is how it works:

First the algorithm calculates a volatility measure. All data on the chart, prior to the testing bar, is used. The formula used is described over here. After the volatility of the market has been calculated, the algorithm measures all market moves for a given number of bars. A standard setting might be to calculate all moves between 5 and 200 bars. From this list of moves, normalised in volatility multiples, the algorithm picks the biggest moves. Then a trigger value is applied and the algorithm checks if the biggest move found is more than e.g. 3 times the expected volatility. To show the found move on the chart, the algorithm waits for another bar, and if this bar does not form a new low for bearish moves or a new high after a bull move, the move is shown on the chart. A reversal or at least an end of the exuberant market move can be expected.

market excess detection

On the chart above you see this new indicator in action. The right chart is Bitcoin on an hourly timeframe, the right one is German power on a daily timeframe. Both charts use the same settings and search excess moves with a length of 5 to 200 bars. The lines are fixed (confirmed) with a 2-bar counter move.

## Some examples for excess detection indicator

To see the effect of different settings have a look at the chart below. All 3 charts detect moves between 10 and 200 (hourly) bars. A 1 bar confirmation delay is used. The difference between the charts is the minimum volatility multiple which is used to detect the excess. From left to right it uses a 1, 3 and 5 times the average fair bet volatility to define the minimum move.

Kahler excess detector – different settings

## Statistical test of excess indicator

If this indicator is any useful, the market should show a different behaviour on the bars after an excess move has been detected than on an average day. To see if this is true the signal efficiency can bet tested using the methodology described in an earlier post.

excess detector test

The chart above shows the excess detector applied on daily JPY Forex data. Only bullish reversals are detected. On the right side you see the average profit factor for the days after a reversal (2*vola, 1 bar confirmation) has been detected. Although it has been a falling market (magenta benchmark below 1) the signal generates showed an average profit factor of more than one – a strong indication that this indicator is able to predict a bullish move after a sell off has been detected. Even in an overall bearish market.

## Usage and general thoughts

There is no indicator which will tell you what the future will bring, but a good indicator will flash a warning sign if the current state of the market is going to change. My excess indicator, like Bollinger Bands and RSI, will tell you when the markets have moved too far. It does this detection independently from a fixed period setting. You have to decide which timeframe you are interested in, e.g. short term = 3 to 10 bars, mid term=10 to 21 bars, long term=21 to 200 bars, and then use the signals of this indicator as a setup to your trading strategy.

If the indicator tells me that there has been an excess bearish move, I will not set up a new short position. I neither would set up a long position if this sell off happened in a bearish market. But I will think about using a tight trailing stop to lock in the profits of my short position.

If there has been an excess bearish move in an uptrend, I might want to start to scale into a long position, using a tight stop loss at the beginning and the let it run until my indicator flashes a warning sign in the other direction.

Never forget that money is made with position sizing and risk management, although a nice indicator can help… :)

You can download the source code of this indicator as a txt file. Copy and paste the content of the text file into a new indicator in Tradesignal and start exploring.  You will need the latest version of TS (10.2) and have a chart with at least 1000 bars of data. By downloading the indicator you are accepting the smallprint.

Kahler’s Excess Detector

# Profit from large daily moves

Whenever the market shows an exceptional day ranges it is time to take bite. See how you can profit from large daily market moves.

## Open-Close Range

When looking at any chart, you will surely notice that the large candles tend to close near the high or low. This is due to herding. Once the market is moving significantly, everyone hops on and the large move becomes even larger. This is true for daily, weekly and intraday candles.

The chart shows an indicator which plots the daily move. Every opening is set to zero and the absolute move of the day is drawn. Around these normalised candles a long term 2 standard deviation volatility band is drawn.  Right now the 2 standard deviation volatility for SPX is about +/- 46 points.

## Take a bite before the market closes

As you can see this +/-46 point barrier above/below the opening of the day is a wonderful entry point. If you enter long 46 points above the opening and go short 46 points below the opening nearly all entries would have lead to a profitable trade. To get an even higher probability of success you can volume as a confirmation. Large moves must also show high volume. The exit is done at the end of the session. This analysis does not give any indication for the next days move. So be fast, take your bite and go home with a small profit and no overnight position.

## No free lunch

On the chart it looks easy, but be careful. As an example the last bar shown on the chart first crossed the band to the downside, reversed and crossed above the upper band. So you will need to use a trailing stop to lock in profits and avoid to take the full -46 to +46 points trade as a loss!

# How to detect unwanted curve fitting during backtest

Whenever you develop an algorithmic trading strategy, unwanted curve fitting is one of the most dangerous hazards. It will lead to substantial losses in real time trading. This article will show you some ways to detect if the performance of your algorithmic trading strategy is based on curve fitting.

## Curve fitting – what is it?

Every algorithmic trading strategy will have some parameters. There is no way around it. You will have to decide what length your indicators have, you will have to specify a specific amount for your stop loss or profit target. Beside the actual rules of your strategy the chosen parameters will usually significantly influence the back-test performance of your strategy. And with any parameter you add the danger of curve fitting rises significantly. Continue reading

# The Edge of an Entry Signal

## Quality of an Entry Signal

When you develop a new idea for an entry signal there are two things you would like to see after the entry: no risk and fast profits. This would be the perfect entry with the highest possible edge. In reality the market response to your entry will be risk and chance. With a good entry the upside would outnumber the downside. Continue reading

# S&P500 – when to be invested

The stock market shows some astonishingly stable date based patterns. Using a performance heat map of the S&P500 index, these patterns are easily found.

## Date based performance

The chart below shows the profit factor of a long only strategy investing in the S&P500. Green is good, red is bad. The strategy is strictly date based. It always buys and sells on specific days of the month. Continue reading

# Noisy Data strategy testing

Adding some random noise to historic market data can be a great way to test the stability of your trading strategy. A stable strategy will show similar profits with noisy and original data. If the noise has a great impact on your results, the strategy might be over fitted to the actual historic data.

## Synthetic market data?

Generating completely synthetic market data to test algorithmic trading strategies is a dangerous endeavour.  You easily lose significant properties like classic chart patterns or the trend properties of your market. Continue reading

# Technical vs. Quantitative Analysis

“The stock market is never obvious. It is designed to fool most of the people, most of the time” Jesse Livermore

## Technical Analysis

Technical analysis is a form of market analysis based on historic price patterns. The basic assumption of technical analysis is, that human behaviour does not change over time, and thus similar historic market behaviour will lead to similar future behaviour. Technical analysis is a predictive form of analysis, a technical analyst will try to estimate what the market might most probably do over the next period of time. Continue reading

# An Algorithmic Stock Picking Portfolio

In this article I will discuss a simple algorithmic stock picking approach based on momentum and volatility. The goal will be to generate excess returns versus a capital weighted stock basket.

## Alpha and Beta

Investing in assets with low volatility and high return is on a lot of peoples wish list. Portfolios which archive this goal will have a high Sharpe ratio and in the end get the investors money. By reverse engineering this criteria, one can find promising stocks to invest in and out perform a given capital weighted index.

Alpha and beta are measures to describe an assets performance relative to its index. Both are used in the CAPM – capital asset pricing model.

Alpha is a measure for an assets excess return compared to an index. Continue reading

# NASDAQ 100 long term candlestick scanner

## A short update on the long term Candlestick Scanner.

The Candlestick Scanner scans the Nasdaq 100 stocks for long term bullish or bearish reversal patterns.

The basic idea is to search for hammer and hanging man candlestick patterns. Usually these patterns work nicely on daily charts. My Candlestick Scanner searches for these two patterns on every time frame, from a 1 day per bar compression up to a  250 days per bar compression. This enables me to use a simple, well defined and documented pattern as a description of short to long term reversal setups.

But see for yourself which Nasdaq stocks seem to change the direction according to the long term Candlestick Scan. The list gives you the duration of the reversal formation (expect about the same time to either reach the target or get stopped out) The detected pattern becomes a valid entry signal if a new high (hammer) or low (hanging man) is established.

Bullish reversals on the left side, bearish reversals on the right side.

# Position sizing – the easy way to great performance

Working on your position sizing algorithm is an easy way to pimp an existing trading strategy. Today we have a look at an energy trading strategy and how the position sizing can influence the performance of the strategy.

The screenshot shows you the returns of the same trading strategy, trading the same markets, the same time frames and using the same parameters. The returns on the left side look nice, making money every year. The returns on the right side are somehow shaky, and you would have to love volatility of returns if you would think about trading this basket. The only difference between the basket on the right and on the left side is the position sizing.

The basket trades German power, base and peak (yearly, quarterly, monthly), coal, gas, emissions. All instruments are traded on a daily and weekly time frame chart, using the same parameters. If the daily trading uses a 10-period parameter, the weekly trading would use a 10-week parameter. This limits the degrees of freedom I have when doing the strategy-time frame-parameter merge, thus minimizing the curve fitting trap.

# Opening Range Breakout

Das Opening Range Breakout System wurde im Magazin “Technical Analysis of Stocks&Commodities” im Juli 1994 besprochen, und wie es scheint, funktioniert es, zumindest ohne slippage uns Speasen, noch immer.

## Ein Opening Range Breakout System von Perry Kaufmann.

Es wurde im Magazin “Technical Analysis of Stocks&Commodities” im Juli 1994 besprochen, und wie es scheint, funktioniert es noch immer. (ohne slippage) Auch Tony Crabel schrieb zu diesem Opening Breakout System im selben Magazin

Das System wartet die erste Handelsstunde ab und geht dann bei Erreichen eines neuen Hochs oder Tiefs  long oder short.  Die Einstiegs Order (Stop Buy / Stop Sell) wird nicht exakt auf das Hoch / Tief gelegt, sondern ein paar Punkte darüber /darunter. (hier 20 Ticks)

## Tradesignal Programmierung des Opening Range Systems

Durch das laden von drei Zeitreihen, 10min, Stunden- und Tagesdaten gestaltet sich die Programmierung sehr einfach. Dies schränkt jedoch die Flexibilität deutlich ein.

Prinzipiell ist die Strategie der Afternoon Trader Strategie sehr ähnlich, sie weist auch mehr Flexibilität in der Programmierung auf. Auch der Artikel über Range Breaks im intraday Markt basiert auf einer ähnlichen Idee.

Da die hier vorgestellte Systemversion  ursprünglich für dieTradestation 2000i in Easy Language geschrieben wurde, ist das Laden von 3 Zeitreihen ein wenig kompliziert gelöst. Aber es funktioniert.

# Selbstlernende Handelssysteme

Ein jeder kennt die klassischen Indikatoren wie RSI oder Stochastic. Und ein jeder kennt die dazugehörigen Handelsanweisungen: Long, wenn überverkauft, Short wenn überkauft. Und zumindest im Lehrbuch funktioniert das auch. Aber wie sieht das ganze am realen Chart aus? Würden Sie dem Lehrbuch vertrauen und Ihren Kunden auch einen baldigen Kauf empfehlen wenn der RSI unter 20 liegt?

## Testen anstatt zu studieren

Schön, wenn ein Indikator im Lehrbuch funktioniert, doch will ich hier ein Verfahren darstellen, bei dem der Indikator selbst angibt ob, wann und wie gut er funktioniert! Dazu habe ich mir für diesen Beitrag den RSI Indikator vorgenommen.

Zunächst wird der Wert des Indikators betrachtet, sowie, ob er steigt oder fällt. Mit diesen beiden Kriterien lässt sich der RSI einfach klassifizieren.

Dann erfolgt der eigentliche Backtest: Innerhalb der letzten 1000 Bars wird nun geschaut, wie sich der Markt bei einem gleichen Indikatorstand (zwischen 90 und 100) und Richtung (über Triggerlinie) verhalten hat.

Am Bild kam dies innerhalb der letzten 100 bars 36 mal vor. Dabei war die durchschnittliche Bewegung innerhalb der darauffolgenden 5 min DAX Futures Kerze -0.03%. Der RSI hat beim aktuellen Stand also eine negative Kurs Prognose.

Dass es auch nach dem nächsten bar statistisch nach unten geht, sieht man an den 5 Prognose Punkten am Chart. Sie zeigen, wie sich der Markt statistisch innerhalb der nächsten 5 Bars verhalten hat, unter der Bedingung, dass der RSI den aktuellen Stand und Richtung hatte.

## Markt Performance als Indikator

Der obige Screenshot zeigt den Indikator und die Prognose für den kommenden bar (sowie die 4 darauf folgenden). Er zeigt jedoch nicht, wie sich diese Prognosen in der Vergangenheit verhalten haben, in welchen Bereichen der Indikator in der Vergangenheit seine höchste Aussagekraft hatte. Dies ist am nächsten Chart dargestellt.

Am Bild ist unter dem eigentlichen RSI seine aktuelle prognose für den nächsten Bar dargestellt. Um diese prognose ist ein Bollingerband gelegt, um so die Bereiche zu definieren, an welchen der RSI seine höchste Aussagekraft hat (= die stärkste Bewegung vorhersagt)

# Reality vs. Robert W. Colby, CMT

## Dont`t believe!

Papier ist geduldig, darum ist es oft besser wenn man selbst testet bevor man ein veröffentlichtes Handelssystem mit seinem Geld ausprobiert. Heute geht es hier um einen Handelssystem out of sample Test

Ein schönes Beispiel dafür ist eine Strategie aus Robert Colbys Buch “The Encyclopedia of Technical Market Indicators“, 2nd edition, 2003, page 791ff.

Darin wird ein einfaches moving average crossover Systeme vorgestellt, welches anscheinend seit beinahe 100 Jahren phänomenale Gewinne verspricht.

Hier eine Kopie aus dem Buch: