Disclaimer: Forex trading involves high risks, with the potential for substantial losses and is not suitable for all persons. The views expressed in this blogsite are those of the author(s) and do not necessarily reflect the official policy, position, or opinions of Global Forex Trading.

Forex Technical Indicators

Learn about forex technical indicators, how to build your own and create adapted indicators for trading forex markets.

Forex technical indicators provide you with techniques for objectively viewing price patters on your currency charts.

 

 

Technical indicators for forex trading are necessary part of analyzing the forex market. No matter what type of trader you are, having the right indicator for forex trading can make a huge difference between a profit and loss. Some technical indicators for forex have been around a long time, while others are being developed on a daily basis. One way forex traders can develop these is through a program called Chart Studio™, which is a free technical indicator-building tool for forex traders.  In this column, experts will teach you how to build your own customized indicators for the forex market.


May 30, 2008

Beware the perils of moving average crossovers!

The stunning truth behind one of the market’s favorite signals…

How many times have I read about moving average crossover signals? How many times have I been asked what are the best two averages to use?

More to the point, how much money are traders prepared to lose using this strategy?

OK, I vented some frustration. Let me explain why I feel so negatively about moving average crossover signals.

I put together a very basic system which bought at the close when the shorter average crossed above the longer and sold at the close when the shorter average crossed below the longer. I could optimize this and come up with a magical result that would have traders drooling and anticipating which sports car they would buy with the profits.

However, here’s the first problem. Optimization really means very little. I’m sure you all know that we can all claim 20:20 hindsight and that reality is that we have to trade without the benefit of knowing how moving averages will optimize before data has developed over a period.

OK, that’s easy to understand but let’s just look at exactly what happens.

What I did was take a daily USDJPY chart from 1995 to 2006. Each year I optimized the data and then applied the resultant optimized parameters to the following year. I optimized the short average for periods between 3 and 15 and the longer average between 15 and 40.

I know this doesn’t really provide the best sample period for an optimization but I can assure you that it does also represent the same testing methods using a longer testing period.

Here are the results:

Year

Optimized P&L

Avg 1

Avg 2

Applied to:

Profit

1995

35.77

15

21

1996

0.31

1996

6.50

9

16

1997

-4.83

1997

18.01

15

17

1998

-12.09

1998

33.73

10

16

1999

2.77

1999

12.24

5

20

2000

3.78

2000

12.99

13

18

2001

4.31

2001

19.78

11

37

2002

-9.59

2002

12.32

14

21

2003

0.37

2003

6.70

3

17

2004

3.11

2004

20.01

6

17

2005

0.18

2005

16.03

15

19

2006

-10.23

2006

2.00

8

18

2007

10.67

Totals

196.08

 

 

 

-16.78

The column at the very left is the year I optimized and is followed by the number of points profit and the optimum moving average lengths. I then applied the strategy using the optimum lengths to the following year’s data and recorded the profit.

As you can see the actual results after applying the optimum lengths to the following year are really quite disastrous! The total of the optimized results and the actual trading results actually turn a very strong profit into a loss…

To highlight why this is, look at the optimum moving average periods running from year to year. The shorter average ranges from a 3 period average in 2003 to a 15 period average seen three times in 1995, 1997 and 2005.

The longer moving average ranges from a 16 period average in 1996 & 1998 to a 37 period average in 2001.

There is no pattern to the numbers and no way of knowing quite what it will turn out to be the following year. This means that the stability of the parameters is very poor. To explain what I mean by this, as an example, I took 1999 which had an optimized profit of 12.24. I optimized only this average and not both and placed the results in a simple bar chart:

Parameter profitability

You can see that only 4 period actually made any profit at all. What is more, the optimum period was more than twice the next highest profit. This means that a small change in market patterns will cause a significant drop in profitability.

When you consider in more than half the years the optimum parameter was above 10 it makes the selection of what parameter to use totally impossible to anticipate.

Is there any way to get around this problem? Well, as far as I have tested, not with moving averages. It is possible to add take profit and stop loss but frankly they are optimized as well and the more variables you add to the system the more unstable it gets.

With systems based on other entry & exit criteria all you can do is optimize and walk forward as I have suggested above. A better period would be to optimize for 5 years and apply the results for the following 6 months. When looking at the results make sure that the optimum parameters do not suffer volatile ups and downs around the optimum. This provides a little more confidence that while you may not get the best result, you won’t get a really bad one either.

Good luck

Ian Copsey

Topic Tags:  currencies, Forex, FX, loss, moving averages, profit, strategy, systems, walk forward

May 23, 2008

Are There Optimum Indicator Parameters?

Are you seeking the optimum parameter to use for your indicators?

I have been training traders for around 17 years and perhaps the most frequently asked question of all goes something like: “What parameters do you use for your moving averages?”

My sincere and honest response is that I don’t use any in my analysis and if I did there is no such thing as an optimum parameter … except in hindsight. However, hindsight is not much worth to us right now.

Is there any such thing as an optimum parameter for any indicator?
Not as far as I am aware.

Are there any mystical powers about indicators which make them predict the market?

No.

Let’s get this straight. All indicators are lagging. This is intrinsically so since they are all calculated from historic prices and there is categorically no argument to say that price develops in a linear fashion that implies indicators can be used to forecast price. I have not found one that predicts the market.

Let’s take an RSI. The default in most platforms is 14. This is because it was considered by Welles Wilder who created RSI that there is a common 28 day cycle in the market and thus an indicator length of half the cycle length is a broad yardstick to use.

If you look back at price history and apply several different length RSIs over that history, at times you will find that (for example) an 8 period will work well during sharper oscillating markets while during broad swinging markets a 14 period may work better.

Well, now we have a game plan. We can use an 8 period RSI when the market is choppy and a 14 period when it’s not... Now look at your chart and decide what will happen from now. There is always an element of judgment involved and no way of saying for certain which length you should use.

The next argument is to optimize the RSI and choose the most profitable periods. Well, it can be done but having written systems I have never found a parameter that works without substantial a drawdown, certainly not one I would care to trade through. In addition, developing a system is not as straightforward as it seems. What if the optimum period is 14 with a profit of 100 but parameters of 12, 13, 15 and 16 only have profits of 25? (This is not an uncommon occurrence.) Would you feel confident that the optimum period was not just an aberration? (In all probability it is.)

So after all that it seems that there is no safe parameter to use for indicators. Frankly I use the default in most cases – at least for momentum indicators – but the bigger issue here is not the indicator but how you use it.

Again let’s take an RSI. Broadly it is commonly used as an overbought/oversold indicator. This is only true during consolidating markets and not trending. You should never use these types of signals from momentum indicators while a trend is in place. Does this mean it is right that, as soon as RSI moves above 70 it is time to sell and below 30 is a time to buy?

No. Definitely not… Here is one of the best bits of advice I can give.

Never take a trade taking a signal from only one form of analysis.

The biggest piece of the puzzle that many (and probably most) traders fail to understand is price. For instance, why take a sell signal because RSI is above 70 but has not moved back below a strategic low. It could be beginning an uptrend and the lows and highs are still moving higher. It could be pausing in a flag formation which is a strong continuation pattern. Remember that many of the best profits come from long positions when momentum indicators are overbought (and short positions when momentum indicators are oversold.)

Always make sure that price is doing something to confirm your trade…

Maybe you see daily RSI above 70. Fine, move down into the hourly charts and see if:
   • There is a price/momentum divergence, or
   • A reversal pattern is developing – then confirmed, or
   • A trend support has been broken.

If any of these occur then your short trade because daily RSI is overbought stands a much greater chance of success.

But what has this got to do with the parameter you choose for the RSI?

Nothing really, but as long as you are using one that is not an extreme and follows the market on the majority of occasions the actual parameter is not important – the combination of the RSI and price should be enough for the majority of trades in this way. Just understand that indicators have their limitations and do not expect them to magically tell you what trade to take. Study price. Understand price. Combine it with indicators and you will have taken a step forward to better profits.

Good luck

Ian Copsey
 

Topic Tags:  currencies, Forex, FX, indicators, optimum, oscillators, parameters, technical analysis

May 16, 2008

Directional Oscillator

Creating a useful directional oscillator

Have you ever looked for an indicator that could provide you with a broad indication of price direction? Well, here’s a nifty little indicator that could help.

It’s very similar to MACD but tends to suffer fewer whipsaws in flatter corrections. The basic concept behind the MACD indicator is instead of using the crossover signals of two moving averages to base signals, it assigns one (exponential) moving average to represent price and a second, longer (exponential) moving average to represent the underlying direction of price.

The problem with just using the crossovers of two moving averages is that the signals can come very late and much of the directional move can be complete when the signal is finally generated.

The MACD, by measuring the width between the averages, is more sensitive to how fast the averages are moving apart (divergence) and also how quickly they are moving together (convergence.)

The drawback of MACD is that it can be so responsive to changes in direction that it can provide a signal too quickly.

The challenge is therefore to devise an oscillator that will remain responsive but avoids some of the premature signals.

Therefore, what I did was use a linear regression average. While all averages have a lag due to the look back period the linear regression average tends to remove some of the lag and move closer with price itself.

What we could do as an indication is merely take the close price and deduct the value of the linear regression average. However, as you can see from the following image it produces a rather choppy result from which signals are not obvious or even useful.

Raw Directional Oscillator

Therefore the challenge was to provide a signal that was more a reflection of the underlying direction. To achieve this I took an average of the linear regression average but to retain sensitivity I used and exponential moving average that gives more weighting to recent values. I used the same period for the exponential moving average as I did for the linear regression average.

Then to avoid whipsaws from price I used a 10 period linear regression average of price. Now, the result is far more useful…

Smoothed Directional Oscillator 

Basically using the crossover of the oscillator through the zero equilibrium line we can generate signals. Very clearly such simple signals are rather raw and we should at least use some basic common sense.

For example, to the middle right of the chart we can see a period of consolidation that caused the oscillator to drop below zero and then recover. When seeing this we should remember that using indicators blindly can make us ignore very simple rules.

We can see that price is consolidating and in these situations it is far wiser to trade on breaks. If price had fallen to break below the first corrective low then it would have been a stronger signal. Until that occurs we can still see that both highs are rising and lows are rising which indicates a potential uptrend.

We may choose to square a long position and then renter once a stronger signal has been generated. If the general trend in a larger time frame (this chart is hourly) we could choose to remain in the position. In this situation it would have paid off.

This Directional Oscillator may be added to your Dealbook charts through the Chart Studio.

Open this Chart Studio and then open a new technique. Cut and paste the following into the area that appears:

Indicator Directional_Oscillator ;
input   Period = 34   ;
draw    DOsc("DO"), Equil("Equilibrium");
vars     f(number), b(number), Res(series), i(number), Avg(series) ;
begin
   f := front(close);
  b := back(close);
  Equil := makeseries(f, b, 0) ;
  Avg := LinReg(Close,Period) ;
  DOsc := LinReg(Close,10) - ema(Avg,period) ;
end.

Following this select “Build” and select “Verify Module” from the top menu bar
You will be prompted to enter a name for this analysis technique. Write in “Directional Oscillator.”

The Select “Build” again and this time you should see this succeed in the output window at the bottom of the studio.

Then select “Build” again but this time choose “Install Module”
The module will be installed into the User Modules.

You will now be able to access Directional Oscillator in the charting application via the “set Up Indicators” icon at the top of the chart.

Good luck.


Ian Copsey

 

 

Topic Tags:  currencies, Direction, exponential moving average, Forex, FX, linear regression, MACD, oscillator, strategies, tardes

Syndication OptionsRSS (Rich Site Summary) Feed Atom Feed OPML (Outline Processor Language) Feed MYST-ML (MyST Markup Language) Content Feed MS-Office Smart Tag Subscription