Featured Post Today
print this page
Latest Post
Tampilkan postingan dengan label series. Tampilkan semua postingan
Tampilkan postingan dengan label series. Tampilkan semua postingan

The Indicators Series The MACD the Markets Speedometer

Todays post will be a continuation of my indicator series of posts which try to explain the mathematical meaning of different indicators and how they can be used successfully to create sound automated trading strategies. The indicator series aims to make emphasis on the importance of understanding the nature of indicators to really know how they can be used successfully in trading. Success when using indicators does not come from just "blue line crosses red line" but from a true understanding of the underlying relationship between the data displayed and the price charts your looking at. This post will focus on the famous MACD indicator created in the 1970s by Gerald Appel.

So what is the MACD indicator ? The MACD, or "moving average convergence-divergence" indicator is nothing more than an expansion onto the idea of moving averages. The indicator has many componente but originally Gerald Appel designed it to have only two : a main line and a signal line. The main line is the difference between to exponential moving averages and the signal line is an exponential moving average of this difference. The histogram, introduced in the 1980s in mainly the difference between the MACD main line and the signal line. The following is a small summary of the tradigional setup (12,26,9).

MACD main line = 26 period EMA - 12 period EMA
MACD signal line = 9 period EMA of the MACD main line
MACD histogram = main line - signal line

But what does this tell us ? I usually look at the MACD as an expansion of the moving average concept. As I told you on the first post on the indicator series - which discussed moving averages - the difference between two moving averages could be interpreted as a sort of "derivative" of averaged price action : A velocity. This is why I usually think of the MACD as the markets speedometer. The MACD main line tells us about the velocity in which price is changing while the histogram tells us the difference between the main line and the signal line which is a measure of the changes in the main line or also a measure of the acceleration of price action (a sort of second derivative of price action). (on a small note, the MACD in mt4 does not display the signal line, only the main line and histogram, they might have considered the introduction of the signal line redundant as crosses between this line and the main line are signaled by the histogram crossing the zero line).
--
Traditionally the MACD is traded in different ways with most of them corresponding to different changes in price action. For example, a cross of the main line through the zero line simply means that the difference between the 26 and 12 emas is zero, that is, the moving averages are crossing. If you trade these signals it would be nothing different than trading a traditional EMA cross. You can also trade crosses of the signal and main lines which would mean that there is a change in the "velocity" of price action. That is, price movement in that direction is "slowing down". That would be the same thing as trading the cross of the histogram through the zero line, since the histogram signals the difference between this two lines. Now the best possible signals of the MACD would come from changes in acceleration, which would go before changes in velocity and would be the most early signals of the MACD. However the tops/bottoms of the MACD histogram are impossible to predict since usually several tops/bottoms can form before any meaningful change in velocity (a cross of the histogram through the zero line). An attempt to do this lies in trading the MACD histogram "divergence" signals with price, such trading is incredibly discretionary and not subject to automation.

Truth be told, the MACD, based on moving averages, has some of the same inherent disadvantages of these indicators with the advantage that the "speedometer" feature of the MACD allows for better entries into the market. However developing an automated trading system using a MACD is not that easy. Usually the problem is that the MACD fails under even only mildly volatile markets due to the sharp changes in velocity that the indicator lags behind. The MACD velocity signals (crosses of the histogram through the zero line) would probably be the best and easiest to implement in coding but a lot of effort must be put in using adaptive money management techniques and exits on MACD signals from a MACD with faster settings which may be able to get the system out of losing trades quickly. Definitely exits will be the most important aspect of a MACD based system. A combination of the MACD signals is also not out of the question. Do you have any ideas for an automated trading strategy using the MACD indicator taking into account all the above ? Make sure you share them with us on the comments :o).

If you would like to learn more about my work with automated trading systems and how you too can learn to develop your own systems with long term profitable results please consider buying my ebook on automated trading or subscribing to my weekly newsletter to receive updates and check the live and demo accounts I am running with several expert advisors. I hope you enjoyed the article !
0 komentar

The Metatrader 5 Series When Huge Backtesting Differences Appear

If you look at my last few weeks of posts I have been very excited about the new qualities of the Metatrader 5 trading platform and the benefits it brings to system development regarding faster execution, faster optimization and added flexibility. Using my prototype implementation of Watukushay FE I analyzed trading over several different instruments and I finally came up with the "starting point" of intra-currency trading for this well-known freely available trading machine. This week I decided to do a small experiment and compare my results of Watukushay FE for the AUD/USD on Metatrader 5 with those found out with Metatrader 4 and the results found were extremely surprising. On todays post I want to talk about my findings, the possible causes of the issues found and what I will be doing to investigate the nature of this problem and what solutions can be implemented to deal with it.

During the first post comparing Metatrader 4 with 5 and the backtesting results of Watukushay FE we already saw a small yet noticeable difference between the testing results obtained on both trading platforms. I talked about the possibility of these errors being feed-related and the fact that the Metatrader 5 history feed might be more reliable since it has been "remastered and fixed" for this new platform. However the difference was small and therefore there was no substantial issue besides an anecdotical note pointing out this curious fact.

However when I decided to run the initial AUD/USD tests on Metatrader 4 to compare the results I obtained with Metatrader 5 the difference changed from "noticeable" to "abismal". The pictures below show you the results for MT5 and MT4 using the exact same settings on the AUD/USD currency pair backtest from 2000 to 2010. The overall equity curve is very different and the results do point out that something is substantially very changed between the historical feeds of MT4 and MT5. I first thought that the difference would be due to the presence of Sunday candles but this turned out to be false since the MT5 feed doesnt have any of them, so regarding this aspect it is the same as MT4. I then thought about the possibility that the whole difference is caused by important changes in data prior to 2006 (before metatrader 4 was launched) and the fact is that data differences are NOT limited to pre 2006 periods, the whole historical feed is different between both trading stations and meaningful differences are present. If you analyze the results youll notice that almost all candles have different - if only very slightly - high/low/open/close values pointing out that RSI and ATR values will be very different. The change in one minute interpolation mechanisms is also not likely a factor here as Watukushay FE strictly controls bar opening on both its MQL4 and MQL5 implementations.
--
What causes such a dramatic change in profitability ? To get to the bottom of this problem I decided to strip down the logic to its simplest form and eliminate the closing logic of the EA, leaving only the entry rules. This shows us that there is still some difference between backtesting results (shown below). This means that differences in results are caused by differences in the RSI and ATR indicator calculations which are dependent on each backtests particular historical feed. Stripping down the logic does reveal that most dependency is located before 2002 with results beyond this date being in better agreement. However there is still some dependency which is caused by differences in data between both historical sets beyond this period.
--
Since we simply cannot know for sure which of the two historical data selections is better - and they are probably both valid within normal broker differences (with the 2000-2002 data being very different probably due to differences between feeds in this period) - it becomes a wise decision to run backtests on both and trust the less profitable results to calculate profit and draw down targets. In some cases like the EUR/USD backtests this proves to be trivial but on others like the one I showed you today doing this mixed analysis proves to be extremely important. I will email the people at metaquotes to get some information about the different nature of the feeds and I will let you know once I have more information about their origin. However up until now all backtests of Watukushay FE seem to be more profitable on MT5 (meaning that our MT4 simulations are in fact the worst case scenario). Investigating other issues which may be related with the closing mechanism of orders in MT5 is also something I am currenlty doing since I have seen that the differences when the closing logic is enabled seem to have other strong causes besides simple feed dependency (more on this on a later post !).

If you would like to learn more about automated trading, the evaluation of expert advisors and the programming of your own strategies please consider buying my ebook on automated trading or joining Asirikuy to receive all ebook purchase benefits, weekly updates, check the live accounts I am running with several expert advisors and get in the road towards long term success in the forex market using automated trading systems. I hope you enjoyed the article !
0 komentar

The Indicator Series The ADX beyond a trend range filter

I have to say that from all the indicators I have used in my career as a forex trader, the ADX (Average Directional Index) is the tool I dislike the most. The reason for this is probably because most traders have become accostumed to viewing the ADX as a range/trend condition filter when this is far from being an accurate use of this trading indicator. People who develop automated trading systems generally use the ADX to filter out trades (which I have learned is not a good approach) generating a global loss of statistical significance with a very small -if even present- improvement in profitability. On todays post I am going to talk to you about this indicator developed by Welles Wilder, I am going to go into its mathematical origin and into how it could be used successfuly for the creation of automated trading strategies. As always the most important thing is to understand what the indicator is telling you and how this information can be used to exploit tradable market inefficiencies.

First of all, the mathematical calculation of this indicator is not as straightforward as others since this tool has many different components. The Average Directional Index indicator is made up of three lines called DI+, DI- and DX. The lines are calculated according to the formula you see below (where the true range is mainly the highest value between the averages calculated, include the average of the close prices (current close - last close) of the N indicator period):

DI+ = Average of X periods [Current High - Previous High]/(Average of X periods of the True range)

DI- = Average of X periods [Current Low- Previous Low]/(Average of X periods of the True range)

DX = 100 * ((DI+)-(DI-)/(DI+)+(DI-))

So what is the indicator telling us ? Mainly the higher the values of DI+ or DI- the higher the difference between the current and past highs/lows becomes relative to the largest movement observed within the current and last candle X period average. However note that DI+ and DI- are not normalized and therefore we can only interpret them relative to each other. A higher value of DI+ over DI- indicates that in average higher highs where achieved while a value of DI- above DI+ indicates the opposite. The DX - which is normalized - compares the difference between DI- and DI+ and tells us what percentage this difference represents from the sum of both indexes. The value of DX will be higher as the difference between DI+ and DI- becomes larger effectively showing that during the past X periods the market has shown a prevalent movement in one direction.

The fact that the DX value seems to be related with prevalent market movement then does not imply that we can define trends/ranges clearly from the ADX. There are two reasons why this is mainly not a good use of the ADX indicator. First of all, the DX line is comparative meaning that if we have a quiet market period with low volatility but a steady up/down movement the indicator may interpret it as a trend. The second problem is related to the fact that you would have to select a "level" to use as a threshold between "ranging and trending" conditions, something which cannot be easily done. Usually if you attempt to enter trades in favor of "the trend" when the DX value is high you will find that the trend has already happened and you are just entering too late.

The ADX indicator however can be used to detect retracements given the fact that it can detect when a weakening from a previously strong trend has happened. For example, if the ADX reaches an extreme value (indicating strong market momentum) we could simply wait for a weaker DX value and enter the trade in the direction of the trend when the trend has apparently "ceased". Of course, we will enter upon a retracement, within a very good position to take advantage of future movements. Such a case is exemplified within the following chart.
-
-
As you see, the ADX indicator can be used for this type of purpose successfuly, not taking into account any range/trend filtering characteristics which are generally attributed to this trading tool. We take advantage of the fact that the indicator signals "what has already happened" and we use it to enter trades in favorable positions to exploit a tradable market inefficiency. Of course, developing a mechanical trading strategy based on this concept would require the development of additional closing criteria and trade analysis (to see which DX levels are adequate) but such an approach is bound to be a good start to develop a long term profitable strategy based on the ADX indicator.

If you would like to learn more about automated trading systems and how you can use systems developed with market adaptability and sound trading in mind to achieve long term profitability please consider buying my ebook on automated trading or joining Asirikuy to receive all ebook purchase benefits, weekly updates, check the live accounts I am running with several expert advisors and get in the road towards long term success in the forex market using automated trading systems. I hope you enjoyed the article !
0 komentar

The Indicator Series The Stochastic Oscillator

Today I will continue my indicator series of posts (which had been a little bit neglected) with a post about the stochastic oscillator which is one of the most popular indicators out there which, by the way, is traded the wrong way in many cases. In order to understand how to trade with the stochastic indicators, what trading systems would benefit from it and which wont, we first need to take a look at the math that defines the stochastic oscillator.

The stochastic oscillator introduced by George lane, simply calculates where price stands against the high and low of a previous amount of periods. That is, you can consider the stochastic oscillator value of as a measure of on what percentage of the range between the low and high of a certain period you are located. The equation that calculates this is as follows:
-
-
As you can see, the stochastic oscillator varies between values of 0 and 100 and as I said, tells you where price is in relation to a certain periods high and low. What does this mean ? Well, it means several things. Depending on the market conditions, the stochastic oscillator behaves differently. When the market is ranging or trending within a channel, the stochastic oscillator will forecast oversold or overbought markets as values near the high of a range are prone to be sold and lows are prone be bought. When the market is trending, things change a little bit since highs are pushed further and further up (lows the opposite) so the oscillator remains at high levels (low levels for down trending markets) all the time and people who are trying to treat that like an overbought or oversold market get killed because they are trading against the trend.

Since we would like to catch trend, which are the most juicy opportunities in the forex market we should only trade the stochastics when they are overbrought or oversold that is, we must follow the reverse of the "traditional" stochastic interpretation. Of course, if you do this and the market ranges, you are always trying to get into a trend that just reverses because the market fails to breakout.

The stochastics has the advantage also of being a leading indicator since it gives signals before the trends actually start. So if you trade the stochastic oscillator with a reversed type logic and a trend following indicator, you might be able to get yourself a profitable system. Although, there might also be the need for the inclusion of volatility type filter and some other creative use of trend following indicators (more on this later !).

All this information about the stochastic oscillator really lets you see how you must know the mathematical basis of an indicator and its true meaning in order to use it effectively in the forex market. As you can see, a traditional interpretation of the stochastics with a trending indicator makes no sense as they constantly contradict each other and you can hope for a breakeven system at best. Stay tuned for the next post on the indicator series which will focus on the MACD, another very popular forex indicator.

If you would like to learn more about how automated trading systems can be traded profitably in the forex market please consider buying my ebook on automated trading or subscribing to my weekly newsletter to receive updates and check the live and demo accounts I am running with several expert advisors. I hope you enjoyed this article !
0 komentar
 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. forcasting forex - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger