26.07.2011 г.

Fractal Wave PM



All the ideas come from the book Volatility illuminated. You can check the site of Mark Whistler

Here I will add the necessary files. You need the FRASMA v2 installed in the experts directory as well, not only the Fractal Wave PM.

Here are the links:






Here is a link for this indicator.


19.07.2011 г.

Fractal Wave PM



I want to show the use of one very interesting indicator mod, that was done by a friend of mine.
This is a major upgrade. It is all about the book "Volatility Illuminated" by Mark Whistler.


The indicator uses the code that is given at the end of the book, but instead to use a Moving average in the calculations of the volatility we use a Fractal adaptive moving average. This is thanks to the work of Jean - Philippe Potton.


I think this mod is available on Forex TSD in my thread about the Digital ASCTrend but if you cannot find it I could upload it. You need to install the fractal moving average FRAMA v2 in order to work.

How we read that?

It is actually very simple. We have two volatilities. Short term volatility and a longer term volatility.

The border line is the level 0.50. If it is above 0.5 we have a good volatility. If it is below 0.5 we have low volatility.

The best signal is when both of them are below 0.5 and the go up together. You can see that that the short term volatility gives some really nice spots when you can enter into an established trend.

What really I like with the mod is that the longer term volatility is much more reactive and that is due to its fractal adaptation.

Bear in mind that this is not a directional indicator.

That is all by now. I will keep it updated.

15.11.2010 г.

Curve fitting or optimization: Statistical versus Phenomenological optimization




When we try to optimize using an optimization algorithm are we doing curve fitting and our model is it going to work in the future?

This is a major problem, there are authors that suggest when we test our system for a long period we should not change its parameters anymore. Others prefer to optimize everyday the parameter of the system.

Where is the truth?

I will try to see the things under other perspective. When we try to optimize a system, we are doing basically a statistical optimization. We optimize return on account, maximum winners, Profit/Loss ratio etc. And we optimize statistically with an algorithm the system.
So how robust are the results when they face the real markets. Well, this is tough question.
Sometimes it works, sometimes it does not. That is the reality.

On the other hand not testing a strategy is suicidal. Some authors state that they limit the variables of the system so the over-fitting is less probable concentrating on the most important things like trend direction and support and resistance zones.

Statistical versus Phenomenological optimization

Phenomenological Theory. A theory which expresses mathematically the results of observed phenomena without paying detailed attention to their fundamental significance

With this kind of optimization we choose to have not one system for all market conditions but some systems phenomenologically optimized for a certain condition.

And we need some criteria to switch between the systems. The Fractal dimension graph index is an useful tool in the phenomenological approach.

For example we can use one system when we have antipersitent fractal characteristics and another when the characteristics of the price are persistent. In fact the adaptive robots are a hype, when they know when to stop trading a particular strategy and when they start again.

6.11.2010 г.

Chart patterns or Chaos attractors?

All the chart patterns can be analyzed as attractors.

That is a modern explanation of the chart patterns that make sense. I will give a definition of an attractor using the Wikipedia. The problem is that the traders do not understand the science of chaos, and the scientists do not understand the trading. As for me I do not understand them both but I will try my best.

An attractor is a set towards which dynamical evolves over time. That is, points that get close enough to the attractor remain close even if slightly disturbed. Geometrically, an attractor can be a point, a curve, a manifold, or even a complicated set with a fractal structure known as a strange attractor. Describing the attractors of chaotic dynamical systems has been one of the achievements of chaos theory.

Please read this short article in the Wikipedia

What is important is that "A dynamical system is generally described by one or more differential or difference equations. The equations of a given dynamic system specify its behavior over any given short period of time. To determine the system's behavior for a longer period, it is necessary to integrate the equations, either through analytical means or through iteration, often with the aid of computers."

And The Fibonacci numbers are defined using the linear recurrence relation. And they can be helfull in the analysis.

According to my analysis the chart patterns can be analyzed as chaotic attractors.

Fixed points: In a trend environment, Higher highs, or lower lows, does it look familiar

Limit cycle: Oscillating price patterns: In fact all the technical analysis chart patterns are in this category: Triangles, Wedges, Harmonic patterns etc.

Limit tori: Complex patterns. It is arguable if they are a part of the technical analysis.
maybe the Elliott Wave Sequence may be close, but I am not sure.

Strange attractors: are not part of the technical analysis. Of course the Elliott wave theoreticians claim that they can predict a lot but their instruments are not adapted to the this task. Moreover those attractors are not necessary for trading, it is better to use lower order attractors for trading.

What is important that the price in the Forex markets are not in the void. They are in a phase space.

The phase space is a space in which all possible states of a system are represented, with each possible state of the system corresponding to one unique point in the phase space. For mechanical systems, the phase space usually consists of all possible values of position and momentum variables.


For example the daily volatility can be analyzed in practice as a phase space of the price time series for the day. Of course as according to the hypothesis that the distribution is not normal but stable paretian with infinite variance this does not holds true, but is an useful practical approach (in fact we can detect in real time with the peaks of Hurst difference how and when the a powerful shift occurs).

Sensitivity to initial conditions

Sensitivity to initial conditions means that each point in such a system is arbitrarily closely approximated by other points with significantly different future trajectories. Thus, an arbitrarily small perturbation of the current trajectory may lead to significantly different future behavior.

In practice a powerful spike even it is corrected will influence the future price action and will set a new set of solutions. If a spike modifies the current phase space (current volatility) it is a signal that the system will be perturbed.

In practice we can analyze the beginning and the end of the market periods.

Let look what happened in the Euro.

For example when we had a powerful trend in September that state was set be the initial conditions. Unless they were not perturbed they set particular attractors that were working. In this case the trend was so simple that it was unbelievable how simple trading can be. But some people did not make money because they cannot believe that and countered the trend for a reversal.

After that Happened in October a break - out in the European session that was directed downwards. What did that mean? That means that the structure of the market has been perturbed. The market started to make another type of patterns: oscillating patterns.

In November this week a powerful shift and spike has occurred. This spike perturbed the structure of the chaotic attractors (cyclic type of patters with nice swings ). The subsequent break - out upwards was a part of the new structure and will participate in the new chaotic attractor that will emerge.

So we can analyze the price action as chaotic attractors in a particular phase space. What is important to know when a powerful shift in the structure occurs. We cannot know how, when, and why and that cannot be predicted. You can analyze that by your experience or you can use an algorithm (like this which is posted on this blog).

The most common errors that is made by the technicians is when a powerful shift in the structure occurs they try to use a pattern that was in force before.

That is a point when the complex neural net models fail, because they are used for a structure that is not anymore valid and a new structure is about to emerge.

This is just a theory guys and gals. But the calculation of the Hurst exponent showed a clear long term process in the markets. The lyapunov exponents calculations showed that even sometimes the processes are really not dissipative.

4.11.2010 г.

The phase of the digital filter







Here I add some shots to illustrate how the phase of a digital filter can make a difference in the trading signal.

The first shot has a phase of the signal +100
The second shot has a phase of the signal +5 (neutral)
The third shot has a phase of the signal -100

The degree of smoothing is 6.

2.11.2010 г.

Fringe Technical Analysis




I am a fan of Fringe. So that is why I can call those ideas as Fringe Technical Analysis. Fractal technical analysis does not sound good anyway.

So the fringe technical analysis covers all the unconventional and strange ideas and methods.

According to the dictionary it means:
something that is marginal, additional, or secondary to some activity, process, or subject

In the blog as a link has been developed some day trading strategies who do not depend on the classical notions of trend. Hey we do not need that stuff. What is important is if the price movement is persistent or anti-persistent and the volatility.

28.10.2010 г.

Pattern recognition?


Does the pattern recognition work?

This is really tough question. The technical analysis rely heavily on pattern recognition. Here I will share my opinion without covering all the issue.

I prefer to rely on more marginal patterns that the most used. I mean that when we have a formed typical pattern, everybody sees it. And when that happens a very complex relationship develops between the market participants. In the litterature it is referred as the insider's game.
Is it the true or just a plausible explanation I do not know.

Anyway I prefer to use more marginal patterns for that reason.

The Law of the charts of Joe Ross is a very good choice.

The Wolfe waves is another good choice.

You can refer to the excellent book Trade Chart Patterns Like The Pros
by Suri Duddella. As he says you need only one pattern to be successful. In this book you can find reference for many patterns in a consistent way.

What happens in the market?

My theory is that in the Forex markets we have long term memory chaotic processes. And then it is possible to accept that what happens now determine the future.

So basically the price movement can be persistent (fractal dimension less than 1.5) or anti-persistent (fractal dimension bigger than 1,5) according to its fractal dimension.

On the market those phases can be seen easily.

-So when a fractal break - out starts we have a transition and during this transition patterns are formed that will indicate how far this break - out is going to go. I mean the Fibonacci relationships.

-When we are into a range-bound and anti-persistent movement often the Wolfe waves give us a clue where the price may go when it goes out of balance.

-Often after the fractal break out the movement starts to consolidate there often we see harmonic patterns to develop.

Forgive me folks I do not have pictures and shots for today. This is only abstract and theoretic stuff.

25.10.2010 г.

High frequency algorithms versus human traders


The topic of the high frequency algorithms is a very hot potato. In fact there is a phenomenon called the rise of the machines. The stock market nowadays is totally dominated by the high frequency algorithmic trading. The old school of the technical analysis is facing hard times.

What is the difference between the high frequency algorithms and the human traders.
In fact the main difference is that the human traders are not cooperative between themselves buts the high frequency algorithms can cooperate in a blink of an eye and create strange moves.

Yes the market may seem the same but an experiences eye can distinguished that its structure is different. It does not behaves the same way like before, the risk level and the volatility is much higher. The volume in the stock market is somewhat artificial. The Forex market is different of course.

Is it possible to use the algorithmic trading trading to the benefit to the medium retail trader?
Well I think that with the fractal dimension analysis we have some tool that we can use.
The exposed ideas have the task not to be a holy grail (not at all in fact) but to reestablish the balance that has bee perturbed by the algorithmic trading.


Risk 1: A systemic risk of market failure

The high frequency algorithms are a source of systemic risk of the market. Remember the flash crash of May 6th 2010? In fact those algorithms work like turbo accelerators of the movement.
The common approach is to look for a software bug, but I think that there is much more than that in the darkness.

My hypothesis is that a proper way to analyze the market is to analyze it as a multidimensional phase space of possible solutions. And what happens? It happens that sometimes this phase space is not too difficult, or in other terms is in the reach of the computing capabilities of the high frequency algorithms. What happens then? It happens that those machines combines their effort and start to cooperate together and all this in a blink of an eye. This is a hypothesis could be valid only when we have many competitive machines and not only one mega machine dominating the whole market.

Risk 2: Point of no return. Are we there?
We have to cope with this new reality. This is true because if they get out of the market the market will collapse in a blink of an eye.

21.10.2010 г.

Prediction versus Observation



A modern market approach consists in not trying to predict based on the gut feeling, technical analysis or even fundamental analysis.

The idea is to try to predict not the market direction but the market state.

1. Cluster the market states:

All the successful traders have in common that they try to distinguish the market state.
A common approach is to use the relationship between the time of the day in the forex markets and the corresponding volatility.

2. Appropriate Use of an adapted system for the period

So when a market state is identified it is necessary to use an adapted system for this market state.

Traditionally there are:

2.1 Intra-day Trend following system

A Moving average strategy is the archetype of those systems.

Neural nets perform very bad as a trend following systems (with some exceptions for Neural Nets specially tuned for those conditions).
Digital filters with genetic optimization do much better


2.2 Intra-day Range Bound system

Oscillator based strategy is the archetype of those systems. Modern oscillators appears to be much smoother but still all the oscillators shares a collinearity.

The neural nets perform well in those conditions.
Statistical indicators performs very well too. In fact the phase space is so big under such conditions that it is more appropriate to model it statistical instruments. The Bollinger bands as a rudimentary statistical instrument is a classic player in the Intra-day range bound systems.


2.3 Break - out system after a contraction of the volatility

Those systems are particular. For example a Neural Net cannot never ever predict a break-out in the forex market.

How to distinguish between those market conditions:

Well the obvious reason is practice, practice, practice and experience, experience, experience
The human mind and the human perception abilities are much more suited to distinguish those states than any machine. For example an image recognition, the machines are still not capable of doing it for now.

There are some methods and some new ones that will be covered later.

My opinion is that the human mind is appropriate to distinguish between the market states. We believe that when a market state is identified it will continue for a while.

Second we use statistical instruments and methods to help us.

And third once a state is identified we use the appropriate tested methodology. For me a tested algorithmic system appropriate for a particular market state outperforms the average human trader.

So we should not try to predict the future. Even if we try to predict this will destroy our capacity of observing. This phenomenon happens because we select and choose to observe only what conforms our hypothesis.

When the prediction is useful?

In fact the prediction is useful when you manage your position once the position is open.

Example 1: Trend prediction

You open a trade in a trending environment for example after a break - out. Your setup was good (a setup is a setup) and once your position is opened and the stop loss is returned to zero, your prediction game starts.

Now you are trying to predict the market, what is going on, what will happen in order to manage a position.

Remember, this is like chess game. Your little position can be like a spawn that can turn up to be a queen, when it reaches the end of the chess board. And in order to be a queen you have to push it forward. And as in the Chess a group of spawns have a better chance to reach their goal, to become a queen.

And vice versa as Glenn Neely observes even if you have a very good prediction capability this will not help you in your trading (even if you are right maybe your timing was wrong, or the stop was hit just before your prediction come true). You need a good setup.

Example 2:
You have a setup in a ranging environment. You buy at an oversold level. Logically you predict that it will reverse when it goes up at an overbought level. And this is prediction after you have opened a position.

Conclusions:
There are two types of trading styles. Those strategies have advantages and disadvantages.

One trading style is based on the prediction: Elliott wave analysis is the best example.

The second trading style is based on a behavior of the market with statistical tools: the price action setups are one of the best examples. For example a break - out strategy in a period with high volatility.

A third strategy is a mixed strategy between a behavioral and prediction. You use your setups as a behavioral strategy and try to manage your winning positions by a prediction strategy.

The advantage of the behavioral strategies is the good win to loose ratio.
The advantage of a prediction strategy is the good R/R ratio.

A mixed strategy tries to combine both.

New dimensions in the trend following philosophy

I personally think that the old school of technical analysis is unproductive in today Forex markets.

The only thing that remains valid is the trendiness. The markets looks similar but it isn't.

In order to use the power of the trend a mechanical and algorithmic system is necessary. It is necessary to have mechanical signals for a trend following strategy. And those signals need to be back tested.

This is not new and a lot of systems work on that basis. What is difficult is to be in the trend and to spot a trend as early as possible.

A recent idea is to use the fractal dimension as a market sentiment indicator. Classically it is used the ADX. But the ADX gives us just a measure of the actual state of the market. It does not see the future in the forex market or whatever market.

The fractal dimension indicators give us probabilities and how they change. This approach is new in the domain of the market following methodology. And we have to use it at its full extent.

We have an experimental system that tries to do that. You can download it from this blog:

http://microhedgefund.blogspot.com/